pub struct ValueDecl {
pub name: String,
pub dtype: Dtype,
pub shape: Vec<u32>,
pub bounds: Bounds,
pub doc: String,
pub slices: Vec<SliceDecl>,
}Expand description
One observation or action.
Fields§
§name: String§dtype: Dtype§shape: Vec<u32>§bounds: Bounds§doc: String§slices: Vec<SliceDecl>Named runs covering the value exactly, in order. Empty for a value with no parts worth naming, such as a small image.
Implementations§
Source§impl ValueDecl
impl ValueDecl
pub fn new( name: &str, dtype: Dtype, shape: &[u32], bounds: Bounds, doc: &str, ) -> Self
Sourcepub fn f32_slices(
name: &str,
doc: &str,
min: f32,
max: f32,
slices: Vec<SliceDecl>,
) -> Self
pub fn f32_slices( name: &str, doc: &str, min: f32, max: f32, slices: Vec<SliceDecl>, ) -> Self
A flat f32 value built from its slices, one shared range.
pub fn with_slices(self, slices: Vec<SliceDecl>) -> Self
pub fn elements(&self) -> usize
pub fn bytes(&self) -> usize
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ValueDecl
impl<'de> Deserialize<'de> for ValueDecl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ValueDecl
Auto Trait Implementations§
impl Freeze for ValueDecl
impl RefUnwindSafe for ValueDecl
impl Send for ValueDecl
impl Sync for ValueDecl
impl Unpin for ValueDecl
impl UnsafeUnpin for ValueDecl
impl UnwindSafe for ValueDecl
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