Struct VarName

struct VarName<'a>(_)

Variable name.

Implementations

impl<'a> VarName<'a>

fn new(s: &'a str) -> Result<Self, Error>

Creates a VarName from the string.

Examples

# use iri_string::template::Error;
use iri_string::template::context::VarName;

let name = VarName::new("hello")?;
assert_eq!(name.as_str(), "hello");

assert!(VarName::new("0+non-variable-name").is_err());

# Ok::<_, Error>(())
fn as_str(self: &Self) -> &'a str

Returns the varibale name.

impl<'a> Clone for VarName<'a>

fn clone(self: &Self) -> VarName<'a>

impl<'a> Copy for VarName<'a>

impl<'a> Debug for VarName<'a>

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

impl<'a> Eq for VarName<'a>

impl<'a> Freeze for VarName<'a>

impl<'a> Hash for VarName<'a>

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl<'a> PartialEq for VarName<'a>

fn eq(self: &Self, other: &VarName<'a>) -> bool

impl<'a> RefUnwindSafe for VarName<'a>

impl<'a> Send for VarName<'a>

impl<'a> StructuralPartialEq for VarName<'a>

impl<'a> Sync for VarName<'a>

impl<'a> Unpin for VarName<'a>

impl<'a> UnsafeUnpin for VarName<'a>

impl<'a> UnwindSafe for VarName<'a>

impl<T> Any for VarName<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for VarName<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for VarName<'a>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for VarName<'a>

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

impl<T> From for VarName<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for VarName<'a>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for VarName<'a>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for VarName<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for VarName<'a>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>