Struct move_core_types::identifier::IdentStr[][src]

#[repr(transparent)]
pub struct IdentStr(_);
Expand description

A borrowed identifier.

For more details, see the module level documentation.

Implementations

impl IdentStr[src]

pub fn new(s: &str) -> Result<&IdentStr>[src]

pub fn is_valid(s: impl AsRef<str>) -> bool[src]

Returns true if this string is a valid identifier.

pub fn len(&self) -> usize[src]

Returns the length of self in bytes.

pub fn is_empty(&self) -> bool[src]

Returns true if self has a length of zero bytes.

pub fn as_str(&self) -> &str[src]

Converts self to a &str.

This is not implemented as a From trait to discourage automatic conversions – these conversions should not typically happen.

pub fn as_bytes(&self) -> &[u8][src]

Converts self to a byte slice.

Trait Implementations

impl AsRef<IdentStr> for Identifier[src]

fn as_ref(&self) -> &IdentStr[src]

Performs the conversion.

impl Borrow<IdentStr> for Identifier[src]

fn borrow(&self) -> &IdentStr[src]

Immutably borrows from an owned value. Read more

impl Debug for IdentStr[src]

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

Formats the value using the given formatter. Read more

impl Display for IdentStr[src]

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

Formats the value using the given formatter. Read more

impl<'a> From<&'a IdentStr> for Identifier[src]

fn from(ident_str: &'a IdentStr) -> Self[src]

Performs the conversion.

impl Hash for IdentStr[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

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

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

impl Ord for IdentStr[src]

fn cmp(&self, other: &IdentStr) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<IdentStr> for IdentStr[src]

fn eq(&self, other: &IdentStr) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &IdentStr) -> bool[src]

This method tests for !=.

impl PartialOrd<IdentStr> for IdentStr[src]

fn partial_cmp(&self, other: &IdentStr) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl RefCast for IdentStr[src]

type From = str

fn ref_cast(_from: &Self::From) -> &Self[src]

fn ref_cast_mut(_from: &mut Self::From) -> &mut Self[src]

impl ToOwned for IdentStr[src]

type Owned = Identifier

The resulting type after obtaining ownership.

fn to_owned(&self) -> Identifier[src]

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

fn clone_into(&self, target: &mut Self::Owned)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl Eq for IdentStr[src]

impl StructuralEq for IdentStr[src]

impl StructuralPartialEq for IdentStr[src]

Auto Trait Implementations

impl RefUnwindSafe for IdentStr

impl Send for IdentStr

impl !Sized for IdentStr

impl Sync for IdentStr

impl Unpin for IdentStr

impl UnwindSafe for IdentStr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more