Skip to main content

LiNo

Enum LiNo 

Source
pub enum LiNo<T> {
    Link {
        id: Option<T>,
        values: Vec<Self>,
    },
    Ref(T),
}

Variants§

Fields

§id: Option<T>
§values: Vec<Self>
§

Ref(T)

Implementations§

Source§

impl<T> LiNo<T>

Source

pub fn is_ref(&self) -> bool

Source

pub fn new(id: Option<T>, values: Vec<Self>) -> Self

Creates a new link with the given ID and values.

This method allows creating links with any number of values, providing an alternative to tuple conversion for cases where more than 12 values are needed.

§Examples
use links_notation::LiNo;

// Create a link with many values
let values: Vec<LiNo<String>> = (1..=20)
    .map(|i| LiNo::Ref(format!("v{}", i)))
    .collect();
let link = LiNo::new(Some("id".to_string()), values);
Source

pub fn anonymous(values: Vec<Self>) -> Self

Creates a new anonymous link (no ID) with the given values.

§Examples
use links_notation::LiNo;

let values = vec![LiNo::Ref("a".to_string()), LiNo::Ref("b".to_string())];
let link = LiNo::anonymous(values);
assert_eq!(format!("{}", link), "(a b)");
Source

pub fn reference(value: T) -> Self

Creates a new reference.

§Examples
use links_notation::LiNo;

let r: LiNo<String> = LiNo::reference("hello".to_string());
assert_eq!(format!("{}", r), "hello");
Source§

impl<T: ToString + Clone> LiNo<T>

Source

pub fn format_with_config(&self, config: &FormatConfig) -> String

Format the link using FormatConfig configuration.

§Arguments
  • config - The FormatConfig to use for formatting
§Returns

Formatted string representation

Trait Implementations§

Source§

impl<T: Clone> Clone for LiNo<T>

Source§

fn clone(&self) -> LiNo<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for LiNo<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ToString> Display for LiNo<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<(&str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str, &str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str, &str, &str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str, &str, &str, &str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str, &str, &str, &str, &str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str, &str, &str, &str, &str, &str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from(tuple: (&str, &str, &str, &str, &str, &str, &str, &str, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str, &str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from( tuple: (&str, &str, &str, &str, &str, &str, &str, &str, &str, &str), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str, &str, &str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from( tuple: (&str, &str, &str, &str, &str, &str, &str, &str, &str, &str, &str), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, &str, &str, &str, &str, &str, &str, &str, &str, &str, &str, &str)> for LiNo<String>

Source§

fn from( tuple: (&str, &str, &str, &str, &str, &str, &str, &str, &str, &str, &str, &str), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>)> for LiNo<String>

Source§

fn from(tuple: (&str, LiNo<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from(tuple: (&str, LiNo<String>, LiNo<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from(tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (&str, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, Vec<&str>)> for LiNo<String>

Convert a tuple of (id, Vec) into a named link.

§Examples

use links_notation::LiNo;

// Create named link with arbitrary number of values
let values: Vec<&str> = vec!["v1", "v2", "v3", "v4", "v5"];
let link: LiNo<String> = ("myLink", values).into();
assert_eq!(format!("{}", link), "(myLink: v1 v2 v3 v4 v5)");
Source§

fn from((id, values): (&str, Vec<&str>)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, Vec<LiNo<String>>)> for LiNo<String>

Convert a tuple of (id, Vec) into a named link.

Source§

fn from((id, values): (&str, Vec<LiNo<String>>)) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from(tuple: (LiNo<String>, LiNo<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from(tuple: (LiNo<String>, LiNo<String>, LiNo<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from(tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>)> for LiNo<String>

Source§

fn from( tuple: (LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>, LiNo<String>), ) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String)> for LiNo<String>

Source§

fn from(tuple: (String, String)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String)> for LiNo<String>

Source§

fn from(tuple: (String, String, String)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String)> for LiNo<String>

Source§

fn from(tuple: (String, String, String, String)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String)> for LiNo<String>

Source§

fn from(tuple: (String, String, String, String, String)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String, String)> for LiNo<String>

Source§

fn from(tuple: (String, String, String, String, String, String)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String, String, String)> for LiNo<String>

Source§

fn from(tuple: (String, String, String, String, String, String, String)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String, String, String, String)> for LiNo<String>

Source§

fn from( tuple: (String, String, String, String, String, String, String, String), ) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String, String, String, String, String)> for LiNo<String>

Source§

fn from( tuple: (String, String, String, String, String, String, String, String, String), ) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String, String, String, String, String, String)> for LiNo<String>

Source§

fn from( tuple: (String, String, String, String, String, String, String, String, String, String), ) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String, String, String, String, String, String, String)> for LiNo<String>

Source§

fn from( tuple: (String, String, String, String, String, String, String, String, String, String, String), ) -> Self

Converts to this type from the input type.
Source§

impl From<(String, String, String, String, String, String, String, String, String, String, String, String)> for LiNo<String>

Source§

fn from( tuple: (String, String, String, String, String, String, String, String, String, String, String, String), ) -> Self

Converts to this type from the input type.
Source§

impl From<(String, Vec<LiNo<String>>)> for LiNo<String>

Convert a tuple of (String id, Vec) into a named link.

Source§

fn from((id, values): (String, Vec<LiNo<String>>)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, Vec<String>)> for LiNo<String>

Convert a tuple of (id, Vec) into a named link.

Source§

fn from((id, values): (String, Vec<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<Link> for LiNo<String>

Source§

fn from(link: Link) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<&str>> for LiNo<String>

Convert a Vec of strings into an anonymous link.

§Examples

use links_notation::LiNo;

// Create anonymous link from vector of any size
let values: Vec<&str> = (1..=20).map(|_| "val").collect();
let link: LiNo<String> = values.into();
Source§

fn from(values: Vec<&str>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<LiNo<String>>> for LiNo<String>

Convert a Vec of LiNo into an anonymous link.

Source§

fn from(values: Vec<LiNo<String>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<String>> for LiNo<String>

Convert a Vec of Strings into an anonymous link.

Source§

fn from(values: Vec<String>) -> Self

Converts to this type from the input type.
Source§

impl<T: PartialEq> PartialEq for LiNo<T>

Source§

fn eq(&self, other: &LiNo<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialEq> StructuralPartialEq for LiNo<T>

Auto Trait Implementations§

§

impl<T> Freeze for LiNo<T>
where Option<T>: Freeze, Vec<LiNo<T>>: Freeze, T: Freeze,

§

impl<T> RefUnwindSafe for LiNo<T>

§

impl<T> Send for LiNo<T>
where Option<T>: Send, Vec<LiNo<T>>: Send, T: Send,

§

impl<T> Sync for LiNo<T>
where Option<T>: Sync, Vec<LiNo<T>>: Sync, T: Sync,

§

impl<T> Unpin for LiNo<T>
where Option<T>: Unpin, Vec<LiNo<T>>: Unpin, T: Unpin,

§

impl<T> UnsafeUnpin for LiNo<T>

§

impl<T> UnwindSafe for LiNo<T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.