pub struct LiNoBuilder { /* private fields */ }Expand description
Builder for creating LiNo links with arbitrary number of values.
This builder provides a fluent API for constructing links when the tuple conversion (limited to 12 elements) is insufficient.
§Examples
use links_notation::{LiNo, LiNoBuilder};
// Build a link with many string values
let link: LiNo<String> = LiNoBuilder::new()
.id("myLink")
.value("v1")
.value("v2")
.value("v3")
.build();
assert_eq!(format!("{}", link), "(myLink: v1 v2 v3)");
// Build a link with LiNo values
let nested: LiNo<String> = ("inner", "a", "b").into();
let link: LiNo<String> = LiNoBuilder::new()
.id("outer")
.lino(nested)
.value("c")
.build();
assert_eq!(format!("{}", link), "(outer: (inner: a b) c)");
// Build anonymous link
let link: LiNo<String> = LiNoBuilder::new()
.value("a")
.value("b")
.build();
assert_eq!(format!("{}", link), "(a b)");Implementations§
Source§impl LiNoBuilder
impl LiNoBuilder
Trait Implementations§
Source§impl Clone for LiNoBuilder
impl Clone for LiNoBuilder
Source§fn clone(&self) -> LiNoBuilder
fn clone(&self) -> LiNoBuilder
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 LiNoBuilder
impl Debug for LiNoBuilder
Source§impl Default for LiNoBuilder
impl Default for LiNoBuilder
Source§fn default() -> LiNoBuilder
fn default() -> LiNoBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LiNoBuilder
impl RefUnwindSafe for LiNoBuilder
impl Send for LiNoBuilder
impl Sync for LiNoBuilder
impl Unpin for LiNoBuilder
impl UnsafeUnpin for LiNoBuilder
impl UnwindSafe for LiNoBuilder
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