pub struct MediaRegName(/* private fields */);
Implementations§
Source§impl MediaRegName
impl MediaRegName
Source§impl MediaRegName
impl MediaRegName
pub fn from_strict_val_unchecked(value: &StrictVal) -> Self
Methods from Deref<Target = AsciiString>§
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of bytes that this ASCII string buffer can hold without reallocating.
§Examples
let s = String::with_capacity(10);
assert!(s.capacity() >= 10);
Methods from Deref<Target = AsciiStr>§
Sourcepub fn as_mut_slice(&mut self) -> &mut [AsciiChar]
pub fn as_mut_slice(&mut self) -> &mut [AsciiChar]
Returns the entire string as mutable slice of AsciiChar
s.
Sourcepub fn as_ptr(&self) -> *const AsciiChar
pub fn as_ptr(&self) -> *const AsciiChar
Returns a raw pointer to the AsciiStr
’s buffer.
The caller must ensure that the slice outlives the pointer this function returns, or else it
will end up pointing to garbage. Modifying the AsciiStr
may cause it’s buffer to be
reallocated, which would also make any pointers to it invalid.
Sourcepub fn as_mut_ptr(&mut self) -> *mut AsciiChar
pub fn as_mut_ptr(&mut self) -> *mut AsciiChar
Returns an unsafe mutable pointer to the AsciiStr
’s buffer.
The caller must ensure that the slice outlives the pointer this function returns, or else it
will end up pointing to garbage. Modifying the AsciiStr
may cause it’s buffer to be
reallocated, which would also make any pointers to it invalid.
Sourcepub fn to_ascii_string(&self) -> AsciiString
pub fn to_ascii_string(&self) -> AsciiString
Copies the content of this AsciiStr
into an owned AsciiString
.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of characters / bytes in this ASCII sequence.
§Examples
let s = AsciiStr::from_ascii("foo").unwrap();
assert_eq!(s.len(), 3);
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the ASCII slice contains zero bytes.
§Examples
let mut empty = AsciiStr::from_ascii("").unwrap();
let mut full = AsciiStr::from_ascii("foo").unwrap();
assert!(empty.is_empty());
assert!(!full.is_empty());
Sourcepub fn chars_mut(&mut self) -> CharsMut<'_>
pub fn chars_mut(&mut self) -> CharsMut<'_>
Returns an iterator over the characters of the AsciiStr
which allows you to modify the
value of each AsciiChar
.
Sourcepub fn split(&self, on: AsciiChar) -> impl DoubleEndedIterator
pub fn split(&self, on: AsciiChar) -> impl DoubleEndedIterator
Returns an iterator over parts of the AsciiStr
separated by a character.
§Examples
let words = AsciiStr::from_ascii("apple banana lemon").unwrap()
.split(AsciiChar::Space)
.map(|a| a.as_str())
.collect::<Vec<_>>();
assert_eq!(words, ["apple", "banana", "lemon"]);
Sourcepub fn lines(&self) -> impl DoubleEndedIterator
pub fn lines(&self) -> impl DoubleEndedIterator
Returns an iterator over the lines of the AsciiStr
, which are themselves AsciiStr
s.
Lines are ended with either LineFeed
(\n
), or CarriageReturn
then LineFeed
(\r\n
).
The final line ending is optional.
Sourcepub fn trim(&self) -> &AsciiStr
pub fn trim(&self) -> &AsciiStr
Returns an ASCII string slice with leading and trailing whitespace removed.
§Examples
let example = AsciiStr::from_ascii(" \twhite \tspace \t").unwrap();
assert_eq!("white \tspace", example.trim());
Sourcepub fn trim_start(&self) -> &AsciiStr
pub fn trim_start(&self) -> &AsciiStr
Returns an ASCII string slice with leading whitespace removed.
§Examples
let example = AsciiStr::from_ascii(" \twhite \tspace \t").unwrap();
assert_eq!("white \tspace \t", example.trim_start());
Sourcepub fn trim_end(&self) -> &AsciiStr
pub fn trim_end(&self) -> &AsciiStr
Returns an ASCII string slice with trailing whitespace removed.
§Examples
let example = AsciiStr::from_ascii(" \twhite \tspace \t").unwrap();
assert_eq!(" \twhite \tspace", example.trim_end());
Sourcepub fn eq_ignore_ascii_case(&self, other: &AsciiStr) -> bool
pub fn eq_ignore_ascii_case(&self, other: &AsciiStr) -> bool
Compares two strings case-insensitively.
Sourcepub fn make_ascii_uppercase(&mut self)
pub fn make_ascii_uppercase(&mut self)
Replaces lowercase letters with their uppercase equivalent.
Sourcepub fn make_ascii_lowercase(&mut self)
pub fn make_ascii_lowercase(&mut self)
Replaces uppercase letters with their lowercase equivalent.
Sourcepub fn to_ascii_uppercase(&self) -> AsciiString
pub fn to_ascii_uppercase(&self) -> AsciiString
Returns a copy of this string where letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’.
Sourcepub fn to_ascii_lowercase(&self) -> AsciiString
pub fn to_ascii_lowercase(&self) -> AsciiString
Returns a copy of this string where letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’.
Trait Implementations§
Source§impl AsRef<RString<AlphaSmall, MimeChar, 1, 64>> for MediaRegName
impl AsRef<RString<AlphaSmall, MimeChar, 1, 64>> for MediaRegName
Source§impl AsRef<str> for MediaRegName
impl AsRef<str> for MediaRegName
Source§impl Borrow<RString<AlphaSmall, MimeChar, 1, 64>> for MediaRegName
impl Borrow<RString<AlphaSmall, MimeChar, 1, 64>> for MediaRegName
Source§impl Borrow<str> for MediaRegName
impl Borrow<str> for MediaRegName
Source§impl Clone for MediaRegName
impl Clone for MediaRegName
Source§fn clone(&self) -> MediaRegName
fn clone(&self) -> MediaRegName
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MediaRegName
impl Debug for MediaRegName
Source§impl Deref for MediaRegName
impl Deref for MediaRegName
Source§impl<'de> Deserialize<'de> for MediaRegName
impl<'de> Deserialize<'de> for MediaRegName
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>,
Source§impl Display for MediaRegName
impl Display for MediaRegName
Source§impl From<&'static str> for MediaRegName
impl From<&'static str> for MediaRegName
Source§impl From<MediaRegName> for Ident
impl From<MediaRegName> for Ident
Source§fn from(name: MediaRegName) -> Self
fn from(name: MediaRegName) -> Self
Source§impl From<MediaRegName> for RString<AlphaSmall, MimeChar, 1, 64>
impl From<MediaRegName> for RString<AlphaSmall, MimeChar, 1, 64>
Source§fn from(wrapped: MediaRegName) -> Self
fn from(wrapped: MediaRegName) -> Self
Source§impl From<MediaRegName> for String
impl From<MediaRegName> for String
Source§fn from(ident: MediaRegName) -> String
fn from(ident: MediaRegName) -> String
Source§impl From<RString<AlphaSmall, MimeChar, 1, 64>> for MediaRegName
impl From<RString<AlphaSmall, MimeChar, 1, 64>> for MediaRegName
Source§impl FromStr for MediaRegName
impl FromStr for MediaRegName
Source§impl Hash for MediaRegName
impl Hash for MediaRegName
Source§impl Ord for MediaRegName
impl Ord for MediaRegName
Source§fn cmp(&self, other: &MediaRegName) -> Ordering
fn cmp(&self, other: &MediaRegName) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for MediaRegName
impl PartialEq for MediaRegName
Source§impl PartialOrd for MediaRegName
impl PartialOrd for MediaRegName
Source§impl Serialize for MediaRegName
impl Serialize for MediaRegName
Source§impl StrictDecode for MediaRegName
impl StrictDecode for MediaRegName
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for MediaRegName
impl StrictDumb for MediaRegName
fn strict_dumb() -> Self
Source§impl StrictEncode for MediaRegName
impl StrictEncode for MediaRegName
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictTuple for MediaRegName
impl StrictTuple for MediaRegName
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for MediaRegName
impl StrictType for MediaRegName
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB21
fn strict_name() -> Option<TypeName>
Source§impl TryFrom<String> for MediaRegName
impl TryFrom<String> for MediaRegName
Source§impl Wrapper for MediaRegName
impl Wrapper for MediaRegName
Source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
impl Eq for MediaRegName
impl StrictProduct for MediaRegName
impl StructuralPartialEq for MediaRegName
Auto Trait Implementations§
impl Freeze for MediaRegName
impl RefUnwindSafe for MediaRegName
impl Send for MediaRegName
impl Sync for MediaRegName
impl Unpin for MediaRegName
impl UnwindSafe for MediaRegName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.