pub struct LocatedCursor<'s> {
pub message: &'s Message<'s>,
pub segment: Option<(&'s str, usize, &'s Segment<'s>)>,
pub field: Option<(usize, &'s Field<'s>)>,
pub repeat: Option<(usize, &'s Repeat<'s>)>,
pub component: Option<(usize, &'s Component<'s>)>,
pub sub_component: Option<(usize, &'s Subcomponent<'s>)>,
}
Expand description
Results from locating a cursor within a message
Fields§
§message: &'s Message<'s>
§segment: Option<(&'s str, usize, &'s Segment<'s>)>
The (segment name, and 1-based segment index) containing the cursor
field: Option<(usize, &'s Field<'s>)>
The (1-based field index, field) containing the cursor
repeat: Option<(usize, &'s Repeat<'s>)>
The (1-based repeat index, repeat) containing the cursor
component: Option<(usize, &'s Component<'s>)>
The (1-based component index, component) containing the cursor
sub_component: Option<(usize, &'s Subcomponent<'s>)>
The (1-based sub-component index, sub-component) containing the cursor
Implementations§
Source§impl<'m> LocatedCursor<'m>
impl<'m> LocatedCursor<'m>
Sourcepub fn raw_value(&self) -> Option<&str>
pub fn raw_value(&self) -> Option<&str>
Get the raw value of the field, repeat, component, or sub-component at the cursor location.
Returns None
if the cursor is not located at a field, repeat, component, or
sub-component.
Sourcepub fn range(&self) -> Option<&'m Range<usize>>
pub fn range(&self) -> Option<&'m Range<usize>>
Get the range of the field, repeat, component, or sub-component at the cursor location.
Returns None
if the cursor is not located at a field, repeat, component, or
sub-component.
Sourcepub fn value(
&'m self,
separators: &'m Separators,
) -> Option<DecodedSeparatorsDisplay<'m>>
pub fn value( &'m self, separators: &'m Separators, ) -> Option<DecodedSeparatorsDisplay<'m>>
Get the decoded value of the field, repeat, component, or sub-component at the cursor
location. Returns None
if the cursor is not located at a field, repeat, component, or
sub-component.
Trait Implementations§
Source§impl<'s> Clone for LocatedCursor<'s>
impl<'s> Clone for LocatedCursor<'s>
Source§fn clone(&self) -> LocatedCursor<'s>
fn clone(&self) -> LocatedCursor<'s>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more