Struct pancake_types::types::SubValueSpec
source · pub struct SubValueSpec {
pub member_idxs: Vec<u32>,
pub datum_type: DatumType,
}Expand description
SubValueSpec specifies a contiguous sub-portion of a Value.
The spec is a DSL for locating this sub-portion, as well as an extractor of this sub-portion.
Specification
member_idxs:
- The empty
member_idxsspecifies the wholeValue. - Each
member_idxspecifies a member within aDatum::Tuple. A series ofmember_idxs specifies members within nested Tuples.
datum_type:
- The
datum_typeequallingDatumType::Tuplespecifies the whole (nested) Tuple.
For example, given a tuple-typed Value
Value(
Datum::Tuple(vec![
Datum::I64(0),
Datum::Tuple(vec![
Datum::I64(1),
Datum::Str(String::from("2")),
Datum::Tuple(vec![
Datum::I64(3),
Datum::Str(String::from("4")),
])
])
])
)
If you want to specify the Datum::I64(1):
SubValueSpec {
member_idxs: vec![1, 0],
datum_type: DatumType::I64,
}
If you want to specify the Datum::Tuple containing data 3 and 4:
SubValueSpec {
member_idxs: vec![1, 2],
datum_type: DatumType::Tuple,
}
Fields§
§member_idxs: Vec<u32>§datum_type: DatumTypeImplementations§
Trait Implementations§
source§impl Debug for SubValueSpec
impl Debug for SubValueSpec
source§impl Hash for SubValueSpec
impl Hash for SubValueSpec
source§impl PartialEq for SubValueSpec
impl PartialEq for SubValueSpec
source§fn eq(&self, other: &SubValueSpec) -> bool
fn eq(&self, other: &SubValueSpec) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for SubValueSpec
impl StructuralEq for SubValueSpec
impl StructuralPartialEq for SubValueSpec
Auto Trait Implementations§
impl RefUnwindSafe for SubValueSpec
impl Send for SubValueSpec
impl Sync for SubValueSpec
impl Unpin for SubValueSpec
impl UnwindSafe for SubValueSpec
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