strck_ident::unicode

Type Alias IdentBuf

Source
pub type IdentBuf<B = String> = Check<UnicodeIdent, B>;
Expand description

Owned checked string containing a Unicode identifier.

See UnicodeIdent for more details.

Aliased Type§

struct IdentBuf<B = String> { /* private fields */ }

Implementations

Source§

impl<I, B> Check<I, B>
where I: Invariant, B: AsRef<str>,

Source

pub fn from_buf(buf: B) -> Result<Check<I, B>, <I as Invariant>::Error>

Returns an Ok if the buffer upholds the invariants, otherwise Err.

Source

pub unsafe fn from_buf_unchecked(buf: B) -> Check<I, B>

Create a new Check without validating the buffer.

§Safety

The buffer must contain a valid string.

Source

pub fn as_ck(&self) -> &Ck<I>

Returns a &Ck that borrows from self.

Source

pub fn into_inner(self) -> B

Returns the inner representation.

Trait Implementations

Source§

impl<I, B> AsRef<Ck<I>> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn as_ref(&self) -> &Ck<I>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<I, B> AsRef<str> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<I, B> Borrow<Ck<I>> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn borrow(&self) -> &Ck<I>

Immutably borrows from an owned value. Read more
Source§

impl<I, B> Clone for Check<I, B>
where I: Clone + Invariant, B: Clone + AsRef<str> + 'static,

Source§

fn clone(&self) -> Check<I, B>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<I, B> Debug for Check<I, B>
where I: Invariant, B: AsRef<str> + Debug,

Source§

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

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

impl<I, B> Deref for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

type Target = Ck<I>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Check<I, B> as Deref>::Target

Dereferences the value.
Source§

impl<I, B> Display for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

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

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

impl<'a, I, B> From<&'a Ck<I>> for Check<I, B>
where I: Invariant, B: AsRef<str> + From<&'a str>,

Source§

fn from(check: &'a Ck<I>) -> Check<I, B>

Converts to this type from the input type.
Source§

impl<I, B> FromStr for Check<I, B>
where I: Invariant, B: for<'a> AsRef<str> + for<'a> From<&'a str>,

Source§

type Err = <I as Invariant>::Error

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Check<I, B>, <Check<I, B> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<I, B> Hash for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<I, B> Ord for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn cmp(&self, other: &Check<I, B>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'a, I, B1, B2> PartialEq<&'a Check<I, B2>> for Check<I, B1>
where I: Invariant, B1: AsRef<str>, B2: AsRef<str>,

Source§

fn eq(&self, other: &&'a Check<I, B2>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, I, B> PartialEq<&'a Ck<I>> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn eq(&self, other: &&'a Ck<I>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, I, B> PartialEq<&'a String> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn eq(&self, other: &&'a String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, I, B> PartialEq<&'a str> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn eq(&self, other: &&'a str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, B1, B2> PartialEq<Check<I, B2>> for Check<I, B1>
where I: Invariant, B1: AsRef<str>, B2: AsRef<str>,

Source§

fn eq(&self, other: &Check<I, B2>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, B> PartialEq<Ck<I>> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn eq(&self, other: &Ck<I>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, B> PartialEq<String> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, B> PartialEq<str> for Check<I, B>
where I: Invariant, B: AsRef<str>,

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, B1, B2> PartialOrd<Check<I, B2>> for Check<I, B1>
where I: Invariant, B1: AsRef<str>, B2: AsRef<str>,

Source§

fn partial_cmp(&self, other: &Check<I, B2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<I, B> Eq for Check<I, B>
where I: Invariant, B: AsRef<str>,