Skip to main content

SimpleNodeRegistry

Struct SimpleNodeRegistry 

Source
pub struct SimpleNodeRegistry { /* private fields */ }
Expand description

Simple in-memory node registry for compilation.

Implementations§

Source§

impl SimpleNodeRegistry

Source

pub fn new() -> Self

An empty registry; populate it with register, register_meta or register_step_meta.

Source

pub fn register_step_meta(&mut self, node_id: impl Into<String>, meta: StepMeta)

Register a step’s metadata, so its schemas take part in validation.

Source

pub fn register(&mut self, node_id: impl Into<String>, filter: &dyn Filter)

Register a filter, taking metadata and config hash from the instance itself.

Source

pub fn register_meta( &mut self, node_id: impl Into<String>, meta: FilterMeta, config_hash: CacheKey, )

Register filter metadata directly, for callers that have no filter instance to hand — a plan received over the wire, a test.

Trait Implementations§

Source§

impl Default for SimpleNodeRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl NodeRegistry for SimpleNodeRegistry

Source§

fn node_meta(&self, node_id: &str) -> Option<NodeMeta>

A node’s contract — schemas, cacheability, effectfulness — whichever kind it is. None means the graph names a node nobody registered, which the compiler reports rather than guesses around.
Source§

fn config_hash(&self, node_id: &str) -> Option<CacheKey>

The node’s configuration identity, folded into cache keys. Required rather than derived because only the registry knows how a node’s configuration is canonicalized (Rust: canonical CBOR of fields; Python: qualname + config + source hash).
Source§

fn meta(&self, node_id: &str) -> Option<FilterMeta>

The computational view, for the phases that only make sense for a filter: gradient flow, differentiable collapsing. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

The receiver as &dyn Any, ready for downcast_ref.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.