pub struct Str<'scale> { /* private fields */ }
Expand description
This represents a string, but defers proper decoding of it until it’s asked for, and avoids allocating.
Implementations§
source§impl<'scale> Str<'scale>
impl<'scale> Str<'scale>
sourcepub fn bytes_from_start(&self) -> &'scale [u8] ⓘ
pub fn bytes_from_start(&self) -> &'scale [u8] ⓘ
The bytes left in the input, starting from this string.
sourcepub fn bytes_after(&self) -> Result<&'scale [u8], DecodeError>
pub fn bytes_after(&self) -> Result<&'scale [u8], DecodeError>
The bytes remaining in the input after this string.
sourcepub fn as_str(&self) -> Result<&'scale str, DecodeError>
pub fn as_str(&self) -> Result<&'scale str, DecodeError>
return a string, failing if the bytes could not be properly utf8-decoded.
Auto Trait Implementations§
impl<'scale> Freeze for Str<'scale>
impl<'scale> RefUnwindSafe for Str<'scale>
impl<'scale> Send for Str<'scale>
impl<'scale> Sync for Str<'scale>
impl<'scale> Unpin for Str<'scale>
impl<'scale> UnwindSafe for Str<'scale>
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