Struct reproto_core::Loc
[−]
[src]
pub struct Loc<T> { /* fields omitted */ }
Methods
impl<T> Loc<T>[src]
pub fn new<P: Into<Pos>>(inner: T, pos: P) -> Loc<T>[src]
ⓘImportant traits for &'a mut Wpub fn value(loc: &Loc<T>) -> &T[src]
pub fn pos(loc: &Loc<T>) -> &Pos[src]
pub fn take(loc: Loc<T>) -> T[src]
pub fn take_pair(loc: Loc<T>) -> (T, Pos)[src]
pub fn borrow_pair(loc: &Loc<T>) -> (&T, &Pos)[src]
pub fn map<U, O>(loc: Loc<T>, op: O) -> Loc<U> where
O: FnOnce(T) -> U, [src]
O: FnOnce(T) -> U,
pub fn and_then<U, O, E: WithPos>(
Loc { inner: inner, pos: pos }: Loc<T>,
op: O
) -> Result<Loc<U>, E> where
O: FnOnce(T) -> Result<U, E>, [src]
Loc { inner: inner, pos: pos }: Loc<T>,
op: O
) -> Result<Loc<U>, E> where
O: FnOnce(T) -> Result<U, E>,
pub fn as_ref(loc: &Loc<T>) -> Loc<&T>[src]
Trait Implementations
impl<T: Clone> Clone for Loc<T>[src]
fn clone(&self) -> Loc<T>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<T: Serialize> Serialize for Loc<T>[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer, [src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> PartialEq for Loc<T> where
T: PartialEq, [src]
T: PartialEq,
fn eq(&self, other: &Self) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<T> Eq for Loc<T> where
T: Eq, [src]
T: Eq,
impl<T> PartialOrd for Loc<T> where
T: PartialOrd, [src]
T: PartialOrd,
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<T> Ord for Loc<T> where
T: Ord,
Self: PartialOrd + Eq, [src]
T: Ord,
Self: PartialOrd + Eq,
fn cmp(&self, other: &Self) -> Ordering[src]
This method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<T> Hash for Loc<T> where
T: Hash, [src]
T: Hash,
fn hash<H>(&self, state: &mut H) where
H: Hasher, [src]
H: Hasher,
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl<T> Deref for Loc<T>[src]
type Target = T
The resulting type after dereferencing.
ⓘImportant traits for &'a mut Wfn deref(&self) -> &T[src]
Dereferences the value.
impl<T> DerefMut for Loc<T>[src]
ⓘImportant traits for &'a mut Wfn deref_mut(&mut self) -> &mut T[src]
Mutably dereferences the value.
impl<T> AsMut<T> for Loc<T>[src]
impl<T> Borrow<T> for Loc<T>[src]
ⓘImportant traits for &'a mut Wfn borrow(&self) -> &T[src]
Immutably borrows from an owned value. Read more
impl<T> Display for Loc<T> where
T: Display, [src]
T: Display,
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<T> Debug for Loc<T> where
T: Debug, [src]
T: Debug,
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more