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 PartialEq<[u8]> for Bytes
impl PartialEq<[u8]> for Bytes
source§impl PartialEq<Bytes> for Bytes
impl PartialEq<Bytes> for Bytes
source§impl PartialOrd<Bytes> for Bytes
impl PartialOrd<Bytes> for Bytes
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Bytes
impl StructuralEq for Bytes
impl StructuralPartialEq for Bytes
Auto Trait Implementations§
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