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>
impl<'a> Scope<'a>
Sourcepub fn walk_group(
&self,
table: &impl GroupLayout,
known: &KnownTags<'_>,
) -> Option<Walk<'a>>
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.
Sourcepub fn get_group(
&self,
table: &impl GroupLayout,
known: &KnownTags<'_>,
) -> Result<Option<Group<'a>>, InvalidValue>
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>
impl<'a> Scope<'a>
Sourcepub fn get(&self, tag: Tag) -> Option<&'a [u8]>
pub fn get(&self, tag: Tag) -> Option<&'a [u8]>
Value of the first occurrence of tag in this scope.
Sourcepub fn get_str(&self, tag: Tag) -> Result<Option<&'a str>, InvalidValue>
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.
Sourcepub fn get_int(&self, tag: Tag) -> Result<Option<i64>, InvalidValue>
pub fn get_int(&self, tag: Tag) -> Result<Option<i64>, InvalidValue>
First occurrence of tag parsed as an integer or Ok(None) when absent.
Sourcepub fn get_bool(&self, tag: Tag) -> Result<Option<bool>, InvalidValue>
pub fn get_bool(&self, tag: Tag) -> Result<Option<bool>, InvalidValue>
First occurrence of tag parsed as a boolean or Ok(None) when absent.
Sourcepub fn get_decimal(&self, tag: Tag) -> Result<Option<Decimal>, InvalidValue>
pub fn get_decimal(&self, tag: Tag) -> Result<Option<Decimal>, InvalidValue>
First occurrence of tag parsed as a decimal or Ok(None) when absent.
Sourcepub fn get_utc_timestamp(
&self,
tag: Tag,
) -> Result<Option<UtcTimestamp>, InvalidValue>
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.
Sourcepub fn get_date(&self, tag: Tag) -> Result<Option<Date>, InvalidValue>
pub fn get_date(&self, tag: Tag) -> Result<Option<Date>, InvalidValue>
First occurrence of tag parsed as a date or Ok(None) when absent.
Sourcepub fn get_time(&self, tag: Tag) -> Result<Option<Time>, InvalidValue>
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.
Sourcepub fn get_month_year(
&self,
tag: Tag,
) -> Result<Option<MonthYear>, InvalidValue>
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§impl<'a> Scope<'a>
impl<'a> Scope<'a>
Sourcepub fn get_multiple_values<T>(
&self,
tag: Tag,
) -> Result<Option<MultipleValues<'a, T>>, InvalidValue>
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.