pub struct Blob<T> { /* private fields */ }
Expand description
Shared data with an associated unique identifier.
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§
source§impl<'de, T> Deserialize<'de> for Blob<T>
impl<'de, T> Deserialize<'de> for Blob<T>
source§fn deserialize<D>(des: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(des: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)