Struct Attribute
struct Attribute(_)
An attribute used in a set of Attributes.
An attribute has to be a sequence of alphanumerical characters no shorter than three and no longer than eight characters.
Examples
use ;
let attr: Attribute =
"buddhist".parse.expect;
assert_eq!;
Implementations
impl Attribute
impl Attribute
const fn try_from_str(s: &str) -> Result<Self, ParseError>A constructor which takes a str slice, parses it and produces a well-formed
Attribute.Examples
use extensions :: unicode Attribute; assert!; assert!;const fn try_from_utf8(code_units: &[u8]) -> Result<Self, ParseError>const fn try_from_raw(raw: [u8; 8]) -> Result<Self, ParseError>Safely creates a
Attributefrom its raw format as returned bySelf::into_raw. UnlikeSelf::try_from_utf8, this constructor only takes normalized values.unsafe const fn from_raw_unchecked(v: [u8; 8]) -> SelfUnsafely creates a
Attributefrom its raw format as returned bySelf::into_raw. UnlikeSelf::try_from_utf8, this constructor only takes normalized values.Safety
This function is safe iff
Self::try_from_rawreturns anOk. This is the case for inputs that are correctly normalized.const fn into_raw(self: Self) -> [u8; 8]Deconstructs into a raw format to be consumed by
from_raw_uncheckedortry_from_raw.const fn as_str(self: &Self) -> &strA helper function for displaying as a
&str.fn strict_cmp(self: Self, other: &[u8]) -> OrderingCompare with BCP-47 bytes.
The return value is equivalent to what would happen if you first converted
selfto a BCP-47 string and then performed a byte comparison.This function is case-sensitive and results in a total order, so it is appropriate for binary search. The only argument producing
Ordering::Equalisself.as_str().as_bytes().fn normalizing_eq(self: Self, other: &str) -> boolCompare with a potentially unnormalized BCP-47 string.
The return value is equivalent to what would happen if you first parsed the BCP-47 string and then performed a structural comparison.
impl AsULE for Attribute
fn to_unaligned(self: Self) -> <Self as >::ULEfn from_unaligned(unaligned: <Self as >::ULE) -> Self
impl Clone for Attribute
fn clone(self: &Self) -> Attribute
impl Copy for Attribute
impl Debug for Attribute
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Display for Attribute
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Attribute
impl Freeze for Attribute
impl FromStr for Attribute
fn from_str(s: &str) -> Result<Self, <Self as >::Err>
impl Hash for Attribute
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl NicheBytes for Attribute
impl Ord for Attribute
fn cmp(self: &Self, other: &Attribute) -> Ordering
impl PartialEq for Attribute
fn eq(self: &Self, other: &Attribute) -> bool
impl PartialOrd for Attribute
fn partial_cmp(self: &Self, other: &Attribute) -> Option<Ordering>
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl StructuralPartialEq for Attribute
impl Sync for Attribute
impl ULE for Attribute
fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
impl Unpin for Attribute
impl UnsafeUnpin for Attribute
impl UnwindSafe for Attribute
impl Writeable for Attribute
fn write_to<W: core::fmt::Write + ?Sized>(self: &Self, sink: &mut W) -> Resultfn writeable_length_hint(self: &Self) -> LengthHint
impl<'a> ZeroMapKV for Attribute
impl<T> Any for Attribute
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Attribute
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Attribute
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Attribute
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ErasedDestructor for Attribute
impl<T> From for Attribute
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Attribute
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Attribute
fn to_string(self: &Self) -> String
impl<T, U> Into for Attribute
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Attribute
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Attribute
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>