Skip to main content

Scope

Struct Scope 

Source
pub struct Scope<'a> { /* private fields */ }
Expand description

A bounded view of a message’s fields - the whole frame or one group instance.

Implementations§

Source§

impl<'a> Scope<'a>

Source

pub fn walk_group( &self, table: &impl GroupLayout, known: &KnownTags<'_>, ) -> Option<Walk<'a>>

Walks the group table describes, or None if its count field is not in this scope.

An instance starts at the delimiter, or wherever one of its tags repeats. A tag the message does not know stays in its instance; any other tag outside the table, or CheckSum, ends the group. Nothing is rejected, and malformed groups are reported as anomalies.

Source

pub fn get_group( &self, table: &impl GroupLayout, known: &KnownTags<'_>, ) -> Result<Option<Group<'a>>, InvalidValue>

The group table describes, or Ok(None) if its count field is absent.

A group malformed in any way is an error on the count tag. A count of zero is an empty group.

Source§

impl<'a> Scope<'a>

Source

pub fn get(&self, tag: Tag) -> Option<&'a [u8]>

Value of the first occurrence of tag in this scope.

Source

pub fn get_str(&self, tag: Tag) -> Result<Option<&'a str>, InvalidValue>

First occurrence of tag as UTF-8 text or Ok(None) when absent.

Source

pub fn get_int(&self, tag: Tag) -> Result<Option<i64>, InvalidValue>

First occurrence of tag parsed as an integer or Ok(None) when absent.

Source

pub fn get_bool(&self, tag: Tag) -> Result<Option<bool>, InvalidValue>

First occurrence of tag parsed as a boolean or Ok(None) when absent.

Source

pub fn get_decimal(&self, tag: Tag) -> Result<Option<Decimal>, InvalidValue>

First occurrence of tag parsed as a decimal or Ok(None) when absent.

Source

pub fn get_utc_timestamp( &self, tag: Tag, ) -> Result<Option<UtcTimestamp>, InvalidValue>

First occurrence of tag parsed as a UTC timestamp or Ok(None) when absent.

Source

pub fn get_date(&self, tag: Tag) -> Result<Option<Date>, InvalidValue>

First occurrence of tag parsed as a date or Ok(None) when absent.

Source

pub fn get_time(&self, tag: Tag) -> Result<Option<Time>, InvalidValue>

First occurrence of tag parsed as a time of day or Ok(None) when absent.

Source

pub fn get_month_year( &self, tag: Tag, ) -> Result<Option<MonthYear>, InvalidValue>

First occurrence of tag parsed as a month or Ok(None) when absent.

Source

pub fn start(&self) -> Slot

The slot of this scope’s first field.

Source

pub fn end(&self) -> Slot

The slot just past this scope’s last field.

Source§

impl<'a> Scope<'a>

Source

pub fn get_multiple_values<T>( &self, tag: Tag, ) -> Result<Option<MultipleValues<'a, T>>, InvalidValue>

The values of a multiple-value field, or Ok(None) when absent.

The field must hold one or more values separated by single spaces.

Trait Implementations§

Source§

impl<'a> Clone for Scope<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Scope<'a>

Source§

impl<'a> Debug for Scope<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for Scope<'a>

§

impl<'a> Freeze for Scope<'a>

§

impl<'a> Move for Scope<'a>

§

impl<'a> RefUnwindSafe for Scope<'a>

§

impl<'a> Send for Scope<'a>

§

impl<'a> Sync for Scope<'a>

§

impl<'a> Unpin for Scope<'a>

§

impl<'a> UnsafeUnpin for Scope<'a>

§

impl<'a> UnwindSafe for Scope<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.