Struct parol::grammar::pos::Pos [−][src]
pub struct Pos { /* fields omitted */ }
Expand description
Position within a Cfg Immutable struct
Implementations
Creates an immutable Pos instance Panics on invalid index values.
Returns true if self is the immediate successor of the given Pos. The relation holds only within a single production, i.e. the pr_index must be equal.
use parol::Pos;
let this : Pos = (0, 2).into();
let that : Pos = (0, 1).into();
assert!(this.follows(&that));
assert!(!that.follows(&this));
let this : Pos = (0, 1).into();
let that : Pos = (0, 1).into();
assert!(!this.follows(&that));
assert!(!that.follows(&this));
let this : Pos = (0, 2).into();
let that : Pos = (1, 1).into();
assert!(!this.preceds(&that));
assert!(!that.preceds(&this));
let this : Pos = (0, 1).into();
let that : Pos = (0, 2).into();
assert!(!this.follows(&that));
assert!(that.follows(&this));
Returns true if self is the immediate predecessor of the given Pos. The relation holds only within a single production, i.e. the pr_index must be equal.
use parol::Pos;
let this : Pos = (0, 2).into();
let that : Pos = (0, 1).into();
assert!(!this.preceds(&that));
assert!(that.preceds(&this));
let this : Pos = (0, 1).into();
let that : Pos = (0, 1).into();
assert!(!this.preceds(&that));
assert!(!that.preceds(&this));
let this : Pos = (0, 1).into();
let that : Pos = (1, 2).into();
assert!(!this.preceds(&that));
assert!(!that.preceds(&this));
let this : Pos = (0, 1).into();
let that : Pos = (0, 2).into();
assert!(this.preceds(&that));
assert!(!that.preceds(&this));
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Pos
impl UnwindSafe for Pos
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.