MMMInputValue

Trait MMMInputValue 

Source
pub trait MMMInputValue:
    DynClone
    + Debug
    + DynHash
    + Send
    + Sync
    + Display
    + Downcast {
    // Required methods
    fn format(&self) -> &(dyn MMMInputFormat + 'static);
    fn scratch_panel_buffer_layout(&self) -> Option<Layout>;
    fn panel_bytes(
        &self,
        i: usize,
        buffer: Option<*mut u8>,
    ) -> Result<*const u8, Error>;
    fn mn(&self) -> usize;
    fn k(&self) -> usize;
    fn opaque_fact(&self) -> &(dyn OpaqueFact + 'static);
    fn same_as(&self, other: &(dyn MMMInputValue + 'static)) -> bool;
    fn extract_at_mn_f16(
        &self,
        mn: usize,
        slice: &mut [f16],
    ) -> Result<(), Error>;
    fn extract_at_mn_f32(
        &self,
        mn: usize,
        slice: &mut [f32],
    ) -> Result<(), Error>;

    // Provided method
    fn panels_count(&self) -> usize { ... }
}

Required Methods§

Source

fn format(&self) -> &(dyn MMMInputFormat + 'static)

Source

fn scratch_panel_buffer_layout(&self) -> Option<Layout>

Source

fn panel_bytes( &self, i: usize, buffer: Option<*mut u8>, ) -> Result<*const u8, Error>

Source

fn mn(&self) -> usize

Source

fn k(&self) -> usize

Source

fn opaque_fact(&self) -> &(dyn OpaqueFact + 'static)

Source

fn same_as(&self, other: &(dyn MMMInputValue + 'static)) -> bool

Source

fn extract_at_mn_f16(&self, mn: usize, slice: &mut [f16]) -> Result<(), Error>

Source

fn extract_at_mn_f32(&self, mn: usize, slice: &mut [f32]) -> Result<(), Error>

Provided Methods§

Implementations§

Source§

impl dyn MMMInputValue

Source

pub fn is<__T>(&self) -> bool
where __T: MMMInputValue,

Returns true if the trait object wraps an object of type __T.

Source

pub fn downcast<__T>( self: Box<dyn MMMInputValue>, ) -> Result<Box<__T>, Box<dyn MMMInputValue>>
where __T: MMMInputValue,

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

Source

pub fn downcast_rc<__T>( self: Rc<dyn MMMInputValue>, ) -> Result<Rc<__T>, Rc<dyn MMMInputValue>>
where __T: MMMInputValue,

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

Source

pub fn downcast_ref<__T>(&self) -> Option<&__T>
where __T: MMMInputValue,

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Source

pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>
where __T: MMMInputValue,

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Trait Implementations§

Source§

impl<'clone> Clone for Box<dyn MMMInputValue + 'clone>

Source§

fn clone(&self) -> Box<dyn MMMInputValue + 'clone>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone> Clone for Box<dyn MMMInputValue + Send + 'clone>

Source§

fn clone(&self) -> Box<dyn MMMInputValue + Send + 'clone>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone> Clone for Box<dyn MMMInputValue + Send + Sync + 'clone>

Source§

fn clone(&self) -> Box<dyn MMMInputValue + Send + Sync + 'clone>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone> Clone for Box<dyn MMMInputValue + Sync + 'clone>

Source§

fn clone(&self) -> Box<dyn MMMInputValue + Sync + 'clone>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'hash> Hash for dyn MMMInputValue + 'hash

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl<'hash> Hash for dyn MMMInputValue + Send + 'hash

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl<'hash> Hash for dyn MMMInputValue + Send + Sync + 'hash

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl<'hash> Hash for dyn MMMInputValue + Sync + 'hash

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl OpaquePayload for Box<dyn MMMInputValue>

Source§

fn same_as(&self, other: &(dyn OpaquePayload + 'static)) -> bool

Source§

fn clarify_to_tensor(&self) -> Result<Option<Arc<Tensor>>, Error>

Implementors§