pub struct Identifier(/* private fields */);Expand description
A move identifier
§BCS
The BCS serialized form for this type is defined by the following ABNF:
identifier = %x01-80 ; length of the identifier
(ALPHA *127(ALPHA / DIGIT / UNDERSCORE)) /
(UNDERSCORE 1*127(ALPHA / DIGIT / UNDERSCORE))
UNDERSCORE = %x95Implementations§
Source§impl Identifier
impl Identifier
pub fn new(identifier: impl AsRef<str>) -> Result<Self, TypeParseError>
pub fn into_inner(self) -> Box<str>
pub fn as_str(&self) -> &str
pub const fn is_valid(s: &str) -> bool
Sourcepub const fn is_valid_char(c: char) -> bool
pub const fn is_valid_char(c: char) -> bool
Return true if this character can appear in a Move identifier.
Note: there are stricter restrictions on whether a character can begin a Move identifier–only alphabetic characters are allowed here.
Methods from Deref<Target = IdentifierRef>§
Trait Implementations§
Source§impl Arbitrary for Identifier
impl Arbitrary for Identifier
Source§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Identifier>
type Strategy = BoxedStrategy<Identifier>
The type of
Strategy used to generate values of type Self.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl Borrow<IdentifierRef> for Identifier
impl Borrow<IdentifierRef> for Identifier
Source§fn borrow(&self) -> &IdentifierRef
fn borrow(&self) -> &IdentifierRef
Immutably borrows from an owned value. Read more
Source§impl Clone for Identifier
impl Clone for Identifier
Source§fn clone(&self) -> Identifier
fn clone(&self) -> Identifier
Returns a duplicate of the value. Read more
1.0.0 · 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 Identifier
impl Debug for Identifier
Source§impl Deref for Identifier
impl Deref for Identifier
Source§type Target = IdentifierRef
type Target = IdentifierRef
The resulting type after dereferencing.
Source§fn deref(&self) -> &IdentifierRef
fn deref(&self) -> &IdentifierRef
Dereferences the value.
Source§impl<'de> Deserialize<'de> for Identifier
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Identifier
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Identifier
impl Display for Identifier
Source§impl From<&IdentifierRef> for Identifier
impl From<&IdentifierRef> for Identifier
Source§fn from(value: &IdentifierRef) -> Self
fn from(value: &IdentifierRef) -> Self
Converts to this type from the input type.
Source§impl FromStr for Identifier
impl FromStr for Identifier
Source§impl Hash for Identifier
impl Hash for Identifier
Source§impl JsonSchema for Identifier
Available on crate feature serde only.
impl JsonSchema for Identifier
Available on crate feature
serde only.Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Identifier
impl Ord for Identifier
Source§fn cmp(&self, other: &Identifier) -> Ordering
fn cmp(&self, other: &Identifier) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<str> for Identifier
impl PartialEq<str> for Identifier
Source§impl PartialEq for Identifier
impl PartialEq for Identifier
Source§impl PartialOrd for Identifier
impl PartialOrd for Identifier
Source§impl Serialize for Identifier
Available on crate feature serde only.
impl Serialize for Identifier
Available on crate feature
serde only.impl Eq for Identifier
impl StructuralPartialEq for Identifier
Auto Trait Implementations§
impl Freeze for Identifier
impl RefUnwindSafe for Identifier
impl Send for Identifier
impl Sync for Identifier
impl Unpin for Identifier
impl UnwindSafe for Identifier
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more