pub struct Bytes { /* private fields */ }
Expand description
An owned, immutable byte array.
use ion_rs::element::Bytes;
let ivm: &[u8] = &[0xEA_u8, 0x01, 0x00, 0xE0]; // Ion 1.0 version marker
let bytes: Bytes = ivm.into();
assert_eq!(&bytes, ivm);
use ion_rs::element::Bytes;
let bytes: Bytes = "hello".into();
assert_eq!(&bytes, "hello".as_bytes());
use ion_rs::element::Bytes;
let bytes: Bytes = b"world".into();
assert_eq!(&bytes, b"world".as_slice());
Trait Implementations§
Source§impl Ord for Bytes
impl Ord for Bytes
Source§impl PartialOrd for Bytes
impl PartialOrd for Bytes
impl Eq for Bytes
impl StructuralPartialEq for Bytes
Auto Trait Implementations§
impl Freeze for Bytes
impl RefUnwindSafe for Bytes
impl Send for Bytes
impl Sync for Bytes
impl Unpin for Bytes
impl UnwindSafe for Bytes
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