pub struct Blob<T> {
data: Arc<dyn AsRef<[T]> + Send + Sync>,
id: u64,
}
Expand description
Shared data with an associated unique identifier.
Fields§
§data: Arc<dyn AsRef<[T]> + Send + Sync>
§id: u64
Implementations§
Source§impl<T> Blob<T>
impl<T> Blob<T>
Sourcepub fn new(data: Arc<dyn AsRef<[T]> + Send + Sync>) -> Self
pub fn new(data: Arc<dyn AsRef<[T]> + Send + Sync>) -> Self
Creates a new blob from the given data and generates a unique identifier.
Sourcepub fn from_raw_parts(data: Arc<dyn AsRef<[T]> + Send + Sync>, id: u64) -> Self
pub fn from_raw_parts(data: Arc<dyn AsRef<[T]> + Send + Sync>, id: u64) -> Self
Creates a new blob from the given data and identifier.
Note that while this function is not unsafe, usage of this in combination
with new
(or with identifiers that are not uniquely associated with the given data)
can lead to inconsistencies.
This is primarily for libraries that wish to interop with vello but are unable to depend on our resource types.
Sourcepub fn into_raw_parts(self) -> (Arc<dyn AsRef<[T]> + Send + Sync>, u64)
pub fn into_raw_parts(self) -> (Arc<dyn AsRef<[T]> + Send + Sync>, u64)
Consumes self and returns the inner components of the blob.
Sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Returns the number of existing strong pointers to this blob.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Blob<T>
impl<T> !RefUnwindSafe for Blob<T>
impl<T> Send for Blob<T>
impl<T> Sync for Blob<T>
impl<T> Unpin for Blob<T>
impl<T> !UnwindSafe for Blob<T>
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