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>,
) -> Result<DescriptorBuffer, VisionError>
pub fn try_binary( rows: usize, bytes_per_row: usize, data: Vec<u8>, ) -> Result<DescriptorBuffer, VisionError>
Creates a checked row-major binary descriptor matrix.
Sourcepub fn try_float32(
rows: usize,
values_per_row: usize,
data: Vec<f32>,
) -> Result<DescriptorBuffer, VisionError>
pub fn try_float32( rows: usize, values_per_row: usize, data: Vec<f32>, ) -> Result<DescriptorBuffer, VisionError>
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
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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