pub struct Blob<'a> {
pub kind: String,
pub fields: Vec<i32>,
pub payload: &'a [u8],
pub properties: BTreeMap<String, String>,
}Expand description
A blob to be written to a Puffin file.
§Examples
use samkhya_core::puffin::Blob;
let payload = b"sketch bytes";
let blob = Blob::new("samkhya.hll-v1", vec![7], payload);
assert_eq!(blob.kind, "samkhya.hll-v1");
assert_eq!(blob.fields, vec![7]);
assert_eq!(blob.payload, payload);Fields§
§kind: String§fields: Vec<i32>§payload: &'a [u8]§properties: BTreeMap<String, String>Implementations§
Source§impl<'a> Blob<'a>
impl<'a> Blob<'a>
Sourcepub fn new(kind: impl Into<String>, fields: Vec<i32>, payload: &'a [u8]) -> Self
pub fn new(kind: impl Into<String>, fields: Vec<i32>, payload: &'a [u8]) -> Self
Build a blob with empty properties. Add metadata afterwards by
inserting into blob.properties.
§Examples
use samkhya_core::puffin::Blob;
let blob = Blob::new("samkhya.bloom-v1", vec![1, 2], &[0u8, 1, 2, 3]);
assert!(blob.properties.is_empty());Auto Trait Implementations§
impl<'a> Freeze for Blob<'a>
impl<'a> RefUnwindSafe for Blob<'a>
impl<'a> Send for Blob<'a>
impl<'a> Sync for Blob<'a>
impl<'a> Unpin for Blob<'a>
impl<'a> UnsafeUnpin for Blob<'a>
impl<'a> UnwindSafe for Blob<'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