Struct print_bytes::ByteStr
source · pub struct ByteStr<'a>(/* private fields */);
Expand description
A value returned by ToBytes::to_bytes
.
This struct is usually initialized by calling the above method for
[u8]
.
Implementations§
source§impl<'a> ByteStr<'a>
impl<'a> ByteStr<'a>
sourcepub fn from_utf8_lossy(string: &'a [u8]) -> Self
Available on Windows only.
pub fn from_utf8_lossy(string: &'a [u8]) -> Self
Wraps a byte string lossily.
This method can be used to implement ToBytes::to_bytes
when
ToBytes::to_wide
is the better way to represent the string.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ByteStr<'a>
impl<'a> RefUnwindSafe for ByteStr<'a>
impl<'a> Send for ByteStr<'a>
impl<'a> Sync for ByteStr<'a>
impl<'a> Unpin for ByteStr<'a>
impl<'a> UnwindSafe for ByteStr<'a>
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