Skip to main content

ObjectBuilder

Struct ObjectBuilder 

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

A builder for constructing a node of same name. This can be used as an easy way to create a node and the references it has to another node in a simple fashion.

Implementations§

Source§

impl ObjectBuilder

Source

pub fn new<T, S>( node_id: &NodeId, browse_name: T, display_name: S, ) -> ObjectBuilder

Creates a builder for a node. All nodes are required to su

Source

pub fn get_node_id(&self) -> &NodeId

Get the node ID of the node being built.

Source

pub fn is_valid(&self) -> bool

Tests that the builder is in a valid state to build or insert the node.

Source

pub fn description<V>(self, description: V) -> ObjectBuilder
where V: Into<LocalizedText>,

Sets the description of the node

Source

pub fn reference<T>( self, node_id: T, reference_type_id: ReferenceTypeId, reference_direction: ReferenceDirection, ) -> ObjectBuilder
where T: Into<NodeId>,

Adds a reference to the node

Source

pub fn organizes<T>(self, organizes_id: T) -> ObjectBuilder
where T: Into<NodeId>,

Indicates this node organizes another node by its id.

Source

pub fn organized_by<T>(self, organized_by_id: T) -> ObjectBuilder
where T: Into<NodeId>,

Indicates this node is organised by another node by its id

Source

pub fn build(self) -> Object

Yields a built node. This function will panic if the node is invalid. Note that calling this function discards any references for the node, so there is no purpose in adding references if you intend to call this method.

Source

pub fn insert(self, address_space: &mut impl NodeInsertTarget) -> bool

Inserts the node into the address space, including references. This function will panic if the node is in an invalid state.

Source§

impl ObjectBuilder

Source

pub fn component_of<T>(self, component_of_id: T) -> ObjectBuilder
where T: Into<NodeId>,

Add an inverse HasComponent reference to the given node.

Source

pub fn has_component<T>(self, has_component_id: T) -> ObjectBuilder
where T: Into<NodeId>,

Add a HasComponent reference to the given node.

Source§

impl ObjectBuilder

Source

pub fn has_property<T>(self, has_component_id: T) -> ObjectBuilder
where T: Into<NodeId>,

Add a HasProperty reference to the given node.

Source

pub fn property_of<T>(self, component_of_id: T) -> ObjectBuilder
where T: Into<NodeId>,

Add an inverse HasProperty reference to the given node.

Source§

impl ObjectBuilder

Source

pub fn is_folder(self) -> ObjectBuilder

Get whether this is building an object with FolderType as the type definition.

Source

pub fn event_notifier(self, event_notifier: EventNotifier) -> ObjectBuilder

Set the event notifier of the object.

Source

pub fn write_mask(self, write_mask: WriteMask) -> ObjectBuilder

Set the write mask of the object.

Source

pub fn has_type_definition(self, type_id: impl Into<NodeId>) -> ObjectBuilder

Add a HasTypeDefinition reference to the given object type.

Source

pub fn has_event_source(self, source_id: impl Into<NodeId>) -> ObjectBuilder

Add a HasEventSource reference to the given node.

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
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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoAnyArc for T
where T: Send + Sync + 'static,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Upcast to Arc<dyn Any>.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more