pub struct Blob { /* private fields */ }Expand description
Raw data attached to a point
ARMS stores this opaquely. You define what it means.
Implementations§
Source§impl Blob
impl Blob
Sourcepub fn new(data: Vec<u8>) -> Self
pub fn new(data: Vec<u8>) -> Self
Create a new blob from bytes
§Example
use arms::Blob;
let blob = Blob::new(vec![1, 2, 3, 4]);
assert_eq!(blob.size(), 4);Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create an empty blob
Useful when you only care about position, not payload.
Sourcepub fn from_str(s: &str) -> Self
pub fn from_str(s: &str) -> Self
Create a blob from a string (UTF-8 bytes)
§Example
use arms::Blob;
let blob = Blob::from_str("hello");
assert_eq!(blob.as_str(), Some("hello"));Sourcepub fn into_inner(self) -> Vec<u8> ⓘ
pub fn into_inner(self) -> Vec<u8> ⓘ
Consume and return the inner data
Trait Implementations§
impl StructuralPartialEq for Blob
Auto Trait Implementations§
impl Freeze for Blob
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