pub struct GeometryGraphBuilder { /* private fields */ }Expand description
Append-only builder that makes cycles and dangling references unrepresentable.
Implementations§
Source§impl GeometryGraphBuilder
impl GeometryGraphBuilder
Sourcepub const fn new() -> GeometryGraphBuilder
pub const fn new() -> GeometryGraphBuilder
Create an empty builder.
Sourcepub fn push(&mut self, node: GeometryNode) -> Result<NodeId, GraphError>
pub fn push(&mut self, node: GeometryNode) -> Result<NodeId, GraphError>
Insert a node. Every reference must be to an earlier node.
Sourcepub fn push_value<T>(&mut self, value: T) -> Result<NodeId, GraphError>where
T: BuiltInNode,
pub fn push_value<T>(&mut self, value: T) -> Result<NodeId, GraphError>where
T: BuiltInNode,
Insert one canonical representation without spelling its enum variant.
The accepted set is deliberately sealed; adapters must translate custom values into a built-in neutral representation before graph construction.
Sourcepub fn finish(self, roots: Vec<NodeId>) -> Result<GeometryGraph, GraphError>
pub fn finish(self, roots: Vec<NodeId>) -> Result<GeometryGraph, GraphError>
Freeze the graph after validating roots.
Trait Implementations§
Source§impl Debug for GeometryGraphBuilder
impl Debug for GeometryGraphBuilder
Source§impl Default for GeometryGraphBuilder
impl Default for GeometryGraphBuilder
Source§fn default() -> GeometryGraphBuilder
fn default() -> GeometryGraphBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GeometryGraphBuilder
impl RefUnwindSafe for GeometryGraphBuilder
impl Send for GeometryGraphBuilder
impl Sync for GeometryGraphBuilder
impl Unpin for GeometryGraphBuilder
impl UnwindSafe for GeometryGraphBuilder
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> 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