pub struct GraphBuilder { /* private fields */ }Implementations§
Source§impl GraphBuilder
impl GraphBuilder
pub fn new() -> Self
pub fn edge_policy(self, edge_policy: EdgePolicy) -> Self
pub fn node<'a>( &'a mut self, label: impl Into<Label>, id: impl Into<NodeId>, ) -> NodeBuilder<'a>
pub fn edge<'a>( &'a mut self, label: impl Into<Label>, from: impl Into<NodeId>, to: impl Into<NodeId>, ) -> EdgeBuilder<'a>
Sourcepub fn add_node(&mut self, node: Node) -> NodeId
pub fn add_node(&mut self, node: Node) -> NodeId
Adds a node, merging with any existing node that has the same id.
If a node with the same id and the same label already exists, the new
props are merged in (new values win). If a node with the same id but a
different label exists, the new node replaces it entirely (last write
wins, matching GraphStore::put_node overwrite semantics).
Sourcepub fn add_edge(&mut self, edge: Edge) -> PutOutcome
pub fn add_edge(&mut self, edge: Edge) -> PutOutcome
Adds an edge, reporting whether it was stored or dropped by the
builder’s EdgePolicy.
pub fn build(self) -> Graph
Trait Implementations§
Source§impl Clone for GraphBuilder
impl Clone for GraphBuilder
Source§fn clone(&self) -> GraphBuilder
fn clone(&self) -> GraphBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphBuilder
impl Debug for GraphBuilder
Source§impl Default for GraphBuilder
impl Default for GraphBuilder
Source§fn default() -> GraphBuilder
fn default() -> GraphBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnsafeUnpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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