pub struct Blob(pub Bytes);
Expand description
An in-memory representation of an Ion blob.
use ion_rs::element::Blob;
let ivm: &[u8] = &[0xEA_u8, 0x01, 0x00, 0xE0]; // Ion 1.0 version marker
let blob: Blob = ivm.into();
assert_eq!(&blob, ivm);
assert_eq!(blob.as_slice().len(), 4);
use ion_rs::element::Blob;
let blob: Blob = "hello".into();
assert_eq!(&blob, "hello".as_bytes());
assert_eq!(blob.as_slice().len(), 5);
Tuple Fields§
§0: Bytes
Implementations§
Trait Implementations§
source§impl PartialEq<[u8]> for Blob
impl PartialEq<[u8]> for Blob
source§impl PartialEq<Blob> for Blob
impl PartialEq<Blob> for Blob
impl Eq for Blob
impl StructuralEq for Blob
impl StructuralPartialEq for Blob
Auto Trait Implementations§
impl RefUnwindSafe for Blob
impl Send for Blob
impl Sync for Blob
impl Unpin for Blob
impl UnwindSafe for Blob
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
source§impl<V> IntoAnnotatedElement for Vwhere
V: Into<Value>,
impl<V> IntoAnnotatedElement for Vwhere V: Into<Value>,
source§fn with_annotations<I: IntoAnnotations>(self, annotations: I) -> Element
fn with_annotations<I: IntoAnnotations>(self, annotations: I) -> Element
Converts the value into an Element with the specified annotations.