Struct combine::stream::PointerOffset [−][src]
Newtype around a pointer offset into a slice stream (&[T]
/&str
).
Implementations
impl PointerOffset
[src]
pub fn translate_position<T>(self, initial_string: &T) -> usize where
T: ?Sized,
[src]
T: ?Sized,
Converts the pointer-based position into an indexed position.
let text = "b"; let err = token('a').easy_parse(text).unwrap_err(); assert_eq!(err.position.0, text.as_ptr() as usize); assert_eq!(err.map_position(|p| p.translate_position(text)).position, 0);
Trait Implementations
impl Clone for PointerOffset
[src]
fn clone(&self) -> PointerOffset
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PointerOffset
[src]
impl Debug for PointerOffset
[src]
impl Default for PointerOffset
[src]
fn default() -> PointerOffset
[src]
impl Display for PointerOffset
[src]
impl Eq for PointerOffset
[src]
impl Ord for PointerOffset
[src]
fn cmp(&self, other: &PointerOffset) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<PointerOffset> for PointerOffset
[src]
fn eq(&self, other: &PointerOffset) -> bool
[src]
fn ne(&self, other: &PointerOffset) -> bool
[src]
impl PartialOrd<PointerOffset> for PointerOffset
[src]
fn partial_cmp(&self, other: &PointerOffset) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for PointerOffset
[src]
impl StructuralPartialEq for PointerOffset
[src]
Auto Trait Implementations
impl RefUnwindSafe for PointerOffset
impl Send for PointerOffset
impl Sync for PointerOffset
impl Unpin for PointerOffset
impl UnwindSafe for PointerOffset
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,