pub struct NodeBuilder(/* private fields */);Expand description
A builder for adding a child node to an existing Node.
Implementations§
Source§impl NodeBuilder
impl NodeBuilder
Sourcepub fn new(node_name: impl Into<String>) -> Self
pub fn new(node_name: impl Into<String>) -> Self
Creates a new [NodeAddBuilder] with the given node_name already set.
Sourcepub fn add_property(
self,
key: impl Into<String>,
value: impl Into<PropertyValue>,
) -> Self
pub fn add_property( self, key: impl Into<String>, value: impl Into<PropertyValue>, ) -> Self
Adds a property to the node. The key argument is something that can convert to a
[PropertyKey], which includes strings and u32 integers. The value argument is
something that can convert into a PropertyValue, which includes strings, u32
integers, and bool values.
Sourcepub fn add_offer(self, offer: Offer) -> Self
pub fn add_offer(self, offer: Offer) -> Self
Adds a service offer to the node. The offer can be built with the
[offers::ZirconServiceOffer] builder.
Sourcepub fn pipe_if<F>(self, condition: bool, callback: F) -> Selfwhere
F: FnOnce(Self) -> Self,
pub fn pipe_if<F>(self, condition: bool, callback: F) -> Selfwhere
F: FnOnce(Self) -> Self,
Triggers the callback if |condition| is true.
Sourcepub fn pipe_opt<T, F>(self, value: Option<T>, callback: F) -> Selfwhere
F: FnOnce(Self, T) -> Self,
pub fn pipe_opt<T, F>(self, value: Option<T>, callback: F) -> Selfwhere
F: FnOnce(Self, T) -> Self,
Triggers the callback if |value| has a some value in it.
Sourcepub fn build(self) -> NodeAddArgs
pub fn build(self) -> NodeAddArgs
Finalize the construction of the node for use with Node::add_child or
Node::add_owned_child.
Auto Trait Implementations§
impl Freeze for NodeBuilder
impl RefUnwindSafe for NodeBuilder
impl Send for NodeBuilder
impl Sync for NodeBuilder
impl Unpin for NodeBuilder
impl UnsafeUnpin for NodeBuilder
impl UnwindSafe for NodeBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to Self§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more