pub struct DescriptorBuffer { /* private fields */ }Expand description
Row-major descriptor matrix with a fixed width and explicit scalar kind.
Implementations§
Source§impl DescriptorBuffer
impl DescriptorBuffer
Sourcepub fn try_binary(
rows: usize,
bytes_per_row: usize,
data: Vec<u8>,
) -> VisionResult<Self>
pub fn try_binary( rows: usize, bytes_per_row: usize, data: Vec<u8>, ) -> VisionResult<Self>
Creates a checked row-major binary descriptor matrix.
Sourcepub fn try_float32(
rows: usize,
values_per_row: usize,
data: Vec<f32>,
) -> VisionResult<Self>
pub fn try_float32( rows: usize, values_per_row: usize, data: Vec<f32>, ) -> VisionResult<Self>
Creates a checked row-major float32 descriptor matrix.
Sourcepub const fn kind(&self) -> DescriptorKind
pub const fn kind(&self) -> DescriptorKind
Returns the descriptor scalar representation.
Sourcepub fn binary_row(&self, index: usize) -> Option<&[u8]>
pub fn binary_row(&self, index: usize) -> Option<&[u8]>
Returns one binary descriptor, or None for a wrong kind or row index.
Sourcepub fn float32_row(&self, index: usize) -> Option<&[f32]>
pub fn float32_row(&self, index: usize) -> Option<&[f32]>
Returns one float descriptor, or None for a wrong kind or row index.
Sourcepub fn binary_data(&self) -> Option<&[u8]>
pub fn binary_data(&self) -> Option<&[u8]>
Returns packed binary storage when the descriptor kind is binary.
Sourcepub fn float32_data(&self) -> Option<&[f32]>
pub fn float32_data(&self) -> Option<&[f32]>
Returns packed float storage when the descriptor kind is float32.
Trait Implementations§
Source§impl Clone for DescriptorBuffer
impl Clone for DescriptorBuffer
Source§fn clone(&self) -> DescriptorBuffer
fn clone(&self) -> DescriptorBuffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DescriptorBuffer
impl Debug for DescriptorBuffer
Source§impl PartialEq for DescriptorBuffer
impl PartialEq for DescriptorBuffer
Source§fn eq(&self, other: &DescriptorBuffer) -> bool
fn eq(&self, other: &DescriptorBuffer) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DescriptorBuffer
Auto Trait Implementations§
impl Freeze for DescriptorBuffer
impl RefUnwindSafe for DescriptorBuffer
impl Send for DescriptorBuffer
impl Sync for DescriptorBuffer
impl Unpin for DescriptorBuffer
impl UnsafeUnpin for DescriptorBuffer
impl UnwindSafe for DescriptorBuffer
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more