Skip to main content

Node

Struct Node 

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

Fluent builder for a single node declaration.

Implementations§

Source§

impl Node

Source

pub fn new(idx: usize) -> Self

Start a node builder for node index idx.

The index is the stable node identifier used throughout the generated graph. It must be unique within the graph.

§Examples
use limen_codegen::builder::Node;
let n = Node::new(0);
Source

pub fn ty<T: 'static>(self) -> Self

Set the concrete node type using a real Rust type T. This avoids calling syn::parse_quote! at the call site.

Source

pub fn in_ports(self, n: usize) -> Self

Set the number of input ports for this node.

If in_ports == 0 and out_ports > 0, the node will be treated as a source by codegen.

Source

pub fn out_ports(self, n: usize) -> Self

Set the number of output ports for this node.

If out_ports == 0 and in_ports > 0, the node will be treated as a sink by codegen.

Source

pub fn in_payload<T: 'static>(self) -> Self

Set the input payload type using a Rust type T.

Source

pub fn out_payload<T: 'static>(self) -> Self

Set the output payload type using a Rust type T.

Source

pub fn name(self, s: Option<&'static str>) -> Self

Set the optional node name from a Rust &'static str (or None).

Source

pub fn ingress_policy(self, p: EdgePolicy) -> Self

Supply a concrete EdgePolicy value for ingress policy (converted internally).

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl !Send for Node

§

impl !Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

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
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, 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.