Struct handy_io::pattern::read::Until
[−]
[src]
pub struct Until<F, T> { /* fields omitted */ }
A pattern which continues reading until the predicate F
is satisfied.
Methods
impl<F, T> Until<F, T>
[src]
fn unwrap(self) -> (F, usize, usize)
fn min_buffer_size(self, size: usize) -> Self
Sets minimum (i.e., initial) buffer size.
fn max_buffer_size(self, size: usize) -> Self
Sets maiximum buffer size allowed to read.
Trait Implementations
impl<R: Read, F, T> ReadFrom<R> for Until<F, T> where
F: Fn(&[u8], bool) -> Result<Option<T>>,
[src]
F: Fn(&[u8], bool) -> Result<Option<T>>,
type Future = ReadUntil<R, F, T>
The future to read a value of the pattern from R
.
fn lossless_read_from(self, reader: R) -> Self::Future
Creates a future instance to read a value of the pattern from reader
.
fn read_from(self, reader: R) -> LossyReadFrom<R, Self::Future>
Creates a future instance to read a value of the pattern from reader
. Read more
fn sync_read_from(self, reader: R) -> Result<Self::Value>
Scynchronously reading a value of the pattern from reader
. Read more
fn boxed(self) -> BoxReadFrom<R, Self::Value> where
Self: Send + 'static,
Self::Future: Send + 'static,
Self: Send + 'static,
Self::Future: Send + 'static,
Returns the boxed version of this pattern.
impl<F: Debug, T: Debug> Debug for Until<F, T>
[src]
impl<F, T> Pattern for Until<F, T>
[src]
type Value = (Vec<u8>, T)
The value type associated to the pattern.
fn then<F, P>(self, f: F) -> Then<Self, F> where
F: FnOnce(Result<Self::Value>) -> P,
F: FnOnce(Result<Self::Value>) -> P,
Takes a closure which maps a Result<Self::Value>
to a pattern, and creates a pattern which calls that closure on the evaluation result of self
. Read more
fn and_then<F, P>(self, f: F) -> AndThen<Self, F> where
F: FnOnce(Self::Value) -> P,
F: FnOnce(Self::Value) -> P,
Takes a closure which maps a value to a pattern, and creates a pattern which calls that closure if the evaluation of self
was succeeded. Read more
fn or_else<F, P>(self, f: F) -> OrElse<Self, F> where
F: FnOnce(Error) -> P,
F: FnOnce(Error) -> P,
Takes a closure which maps an error to a pattern, and creates a pattern which calls that closure if the evaluation of self
failed. Read more
fn map<F, T>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Value) -> T,
F: FnOnce(Self::Value) -> T,
Takes a closure which maps a value to another value, and creates a pattern which calls that closure on the evaluated value of self
. Read more
fn chain<P>(self, other: P) -> Chain<Self, P> where
P: Pattern,
P: Pattern,
Takes two patterns and creates a new pattern over both in sequence. Read more
fn repeat(self) -> Repeat<Self> where
Self: Clone,
Self: Clone,
Creates Repeat
pattern to represent an infinite stream of this pattern.