Struct Record

Source
pub struct Record(/* private fields */);
Expand description

Represents a record.

Implementations§

Source§

impl Record

Source

pub fn empty() -> Self

Construct empty record.

Source

pub fn from_slice<K: Into<String> + Clone>(s: &[(K, RecordValue)]) -> Self

Create Record from slice of (Into<String>, RecordValue).

Source

pub fn keys(&self) -> Keys<'_, String, RecordValue>

Get keys.

Source

pub fn insert(&mut self, k: impl Into<String>, v: RecordValue)

Insert a key-value pair into the record.

Source

pub fn iter(&self) -> Iter<'_, String, RecordValue>

Return an iterator over key-value pairs in the record.

Source

pub fn into_iter_in_record(self) -> IntoIter<String, RecordValue>

Return an iterator over key-value pairs in the record.

Source

pub fn get(&self, k: &str) -> Option<&RecordValue>

Get the value of the given key.

Source

pub fn merge(self, record: Record) -> Self

Merge records.

Source

pub fn get_scalar(&self, k: &str) -> Result<f32, LrrError>

Get scalar value.

  • key - The key of an entry in the record.
Source

pub fn get_array1(&self, k: &str) -> Result<Vec<f32>, LrrError>

Get Array1 value.

Source

pub fn get_array2(&self, k: &str) -> Result<(Vec<f32>, [usize; 2]), LrrError>

Get Array2 value.

Source

pub fn get_array3(&self, k: &str) -> Result<(Vec<f32>, [usize; 3]), LrrError>

Get Array3 value.

Source

pub fn get_string(&self, k: &str) -> Result<String, LrrError>

Get String value.

Source

pub fn is_empty(&self) -> bool

Returns true if the record is empty.

Trait Implementations§

Source§

impl Debug for Record

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Record

§

impl RefUnwindSafe for Record

§

impl Send for Record

§

impl Sync for Record

§

impl Unpin for Record

§

impl UnwindSafe for Record

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V