Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

StructEncoded

Source
pub struct Encoded {/* private fields */ }
Expand description

An encoded message.

This struct facilitates the implementation of IMAP client- and server implementations byyielding the encoding of a message throughFragments. This is required, because the usage ofliterals (and some other types) may change the IMAP message flow. Thus, in many cases, it is anerror to just “dump” a message and send it over the network.

§Example

useimap_codec::{    encode::{Encoder, Fragment},    imap_types::command::{Command, CommandBody},    CommandCodec,};letcmd = Command::new("A", CommandBody::login("alice","pass").unwrap()).unwrap();forfragmentinCommandCodec::default().encode(&cmd) {matchfragment {        Fragment::Line { data } => {}        Fragment::Literal { data, mode } => {}    }}

Implementations§

Source§

implEncoded

Source

pub fndump(self) ->Vec<u8>

Dump the (remaining) encoded data without being guided byFragments.

Trait Implementations§

Source§

implClone forEncoded

Source§

fnclone(&self) ->Encoded

Returns a duplicate of the value.Read more
1.0.0 ·Source§

fnclone_from(&mut self, source: &Self)

Performs copy-assignment fromsource.Read more
Source§

implDebug forEncoded

Source§

fnfmt(&self, f: &mutFormatter<'_>) ->Result

Formats the value using the given formatter.Read more
Source§

implIterator forEncoded

Source§

typeItem =Fragment

The type of the elements being iterated over.
Source§

fnnext(&mut self) ->Option<Self::Item>

Advances the iterator and returns the next value.Read more
Source§

fnnext_chunk<const N:usize>( &mut self,) ->Result<[Self::Item;N],IntoIter<Self::Item, N>>
where Self:Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the nextN values.Read more
1.0.0 ·Source§

fnsize_hint(&self) -> (usize,Option<usize>)

Returns the bounds on the remaining length of the iterator.Read more
1.0.0 ·Source§

fncount(self) ->usize
where Self:Sized,

Consumes the iterator, counting the number of iterations and returning it.Read more
1.0.0 ·Source§

fnlast(self) ->Option<Self::Item>
where Self:Sized,

Consumes the iterator, returning the last element.Read more
Source§

fnadvance_by(&mut self, n:usize) ->Result<(),NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator byn elements.Read more
1.0.0 ·Source§

fnnth(&mut self, n:usize) ->Option<Self::Item>

Returns thenth element of the iterator.Read more
1.28.0 ·Source§

fnstep_by(self, step:usize) ->StepBy<Self>
where Self:Sized,

Creates an iterator starting at the same point, but stepping bythe given amount at each iteration.Read more
1.0.0 ·Source§

fnchain<U>(self, other: U) ->Chain<Self, <U asIntoIterator>::IntoIter>
where Self:Sized, U:IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence.Read more
1.0.0 ·Source§

fnzip<U>(self, other: U) ->Zip<Self, <U asIntoIterator>::IntoIter>
where Self:Sized, U:IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs.Read more
Source§

fnintersperse(self, separator: Self::Item) ->Intersperse<Self>
where Self:Sized, Self::Item:Clone,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places a copy ofseparator between adjacentitems of the original iterator.Read more
Source§

fnintersperse_with<G>(self, separator: G) ->IntersperseWith<Self, G>
where Self:Sized, G:FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated byseparatorbetween adjacent items of the original iterator.Read more
1.0.0 ·Source§

fnmap<B, F>(self, f: F) ->Map<Self, F>
where Self:Sized, F:FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on eachelement.Read more
1.21.0 ·Source§

fnfor_each<F>(self, f: F)
where Self:Sized, F:FnMut(Self::Item),

Calls a closure on each element of an iterator.Read more
1.0.0 ·Source§

fnfilter<P>(self, predicate: P) ->Filter<Self, P>
where Self:Sized, P:FnMut(&Self::Item) ->bool,

Creates an iterator which uses a closure to determine if an elementshould be yielded.Read more
1.0.0 ·Source§

fnfilter_map<B, F>(self, f: F) ->FilterMap<Self, F>
where Self:Sized, F:FnMut(Self::Item) ->Option<B>,

Creates an iterator that both filters and maps.Read more
1.0.0 ·Source§

fnenumerate(self) ->Enumerate<Self>
where Self:Sized,

Creates an iterator which gives the current iteration count as well asthe next value.Read more
1.0.0 ·Source§

fnpeekable(self) ->Peekable<Self>
where Self:Sized,

Creates an iterator which can use thepeek andpeek_mut methodsto look at the next element of the iterator without consuming it. Seetheir documentation for more information.Read more
1.0.0 ·Source§

fnskip_while<P>(self, predicate: P) ->SkipWhile<Self, P>
where Self:Sized, P:FnMut(&Self::Item) ->bool,

Creates an iterator thatskips elements based on a predicate.Read more
1.0.0 ·Source§

fntake_while<P>(self, predicate: P) ->TakeWhile<Self, P>
where Self:Sized, P:FnMut(&Self::Item) ->bool,

Creates an iterator that yields elements based on a predicate.Read more
1.57.0 ·Source§

fnmap_while<B, P>(self, predicate: P) ->MapWhile<Self, P>
where Self:Sized, P:FnMut(Self::Item) ->Option<B>,

Creates an iterator that both yields elements based on a predicate and maps.Read more
1.0.0 ·Source§

fnskip(self, n:usize) ->Skip<Self>
where Self:Sized,

Creates an iterator that skips the firstn elements.Read more
1.0.0 ·Source§

fntake(self, n:usize) ->Take<Self>
where Self:Sized,

Creates an iterator that yields the firstn elements, or fewerif the underlying iterator ends sooner.Read more
1.0.0 ·Source§

fnscan<St, B, F>(self, initial_state: St, f: F) ->Scan<Self, St, F>
where Self:Sized, F:FnMut(&mut St, Self::Item) ->Option<B>,

An iterator adapter which, likefold, holds internal state, butunlikefold, produces a new iterator.Read more
1.0.0 ·Source§

fnflat_map<U, F>(self, f: F) ->FlatMap<Self, U, F>
where Self:Sized, U:IntoIterator, F:FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure.Read more
Source§

fnmap_windows<F, R, const N:usize>(self, f: F) ->MapWindows<Self, F, N>
where Self:Sized, F:FnMut(&[Self::Item;N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given functionf for each contiguous window of sizeN overself and returns an iterator over the outputs off. Likeslice::windows(),the windows during mapping overlap as well.Read more
1.0.0 ·Source§

fnfuse(self) ->Fuse<Self>
where Self:Sized,

Creates an iterator which ends after the firstNone.Read more
1.0.0 ·Source§

fninspect<F>(self, f: F) ->Inspect<Self, F>
where Self:Sized, F:FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on.Read more
1.0.0 ·Source§

fnby_ref(&mut self) -> &mut Self
where Self:Sized,

Creates a “by reference” adapter for this instance ofIterator.Read more
1.0.0 ·Source§

fncollect<B>(self) -> B
where B:FromIterator<Self::Item>, Self:Sized,

Transforms an iterator into a collection.Read more
Source§

fncollect_into<E>(self, collection:&mut E) ->&mut E
where E:Extend<Self::Item>, Self:Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection.Read more
1.0.0 ·Source§

fnpartition<B, F>(self, f: F) ->(B, B)
where Self:Sized, B:Default +Extend<Self::Item>, F:FnMut(&Self::Item) ->bool,

Consumes an iterator, creating two collections from it.Read more
Source§

fnis_partitioned<P>(self, predicate: P) ->bool
where Self:Sized, P:FnMut(Self::Item) ->bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate,such that all those that returntrue precede all those that returnfalse.Read more
1.27.0 ·Source§

fntry_fold<B, F, R>(&mut self, init: B, f: F) -> R
where Self:Sized, F:FnMut(B, Self::Item) -> R, R:Try<Output = B>,

An iterator method that applies a function as long as it returnssuccessfully, producing a single, final value.Read more
1.27.0 ·Source§

fntry_for_each<F, R>(&mut self, f: F) -> R
where Self:Sized, F:FnMut(Self::Item) -> R, R:Try<Output =()>,

An iterator method that applies a fallible function to each item in theiterator, stopping at the first error and returning that error.Read more
1.0.0 ·Source§

fnfold<B, F>(self, init: B, f: F) -> B
where Self:Sized, F:FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation,returning the final result.Read more
1.51.0 ·Source§

fnreduce<F>(self, f: F) ->Option<Self::Item>
where Self:Sized, F:FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducingoperation.Read more
Source§

fntry_reduce<R>( &mut self, f: implFnMut(Self::Item, Self::Item) -> R,) -> <<R asTry>::Residual asResidual<Option<<R asTry>::Output>>>::TryType
where Self:Sized, R:Try<Output = Self::Item>, <R asTry>::Residual:Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If theclosure returns a failure, the failure is propagated back to the caller immediately.Read more
1.0.0 ·Source§

fnall<F>(&mut self, f: F) ->bool
where Self:Sized, F:FnMut(Self::Item) ->bool,

Tests if every element of the iterator matches a predicate.Read more
1.0.0 ·Source§

fnany<F>(&mut self, f: F) ->bool
where Self:Sized, F:FnMut(Self::Item) ->bool,

Tests if any element of the iterator matches a predicate.Read more
1.0.0 ·Source§

fnfind<P>(&mut self, predicate: P) ->Option<Self::Item>
where Self:Sized, P:FnMut(&Self::Item) ->bool,

Searches for an element of an iterator that satisfies a predicate.Read more
1.30.0 ·Source§

fnfind_map<B, F>(&mut self, f: F) ->Option<B>
where Self:Sized, F:FnMut(Self::Item) ->Option<B>,

Applies function to the elements of iterator and returnsthe first non-none result.Read more
Source§

fntry_find<R>( &mut self, f: implFnMut(&Self::Item) -> R,) -> <<R asTry>::Residual asResidual<Option<Self::Item>>>::TryType
where Self:Sized, R:Try<Output =bool>, <R asTry>::Residual:Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returnsthe first true result or the first error.Read more
1.0.0 ·Source§

fnposition<P>(&mut self, predicate: P) ->Option<usize>
where Self:Sized, P:FnMut(Self::Item) ->bool,

Searches for an element in an iterator, returning its index.Read more
1.6.0 ·Source§

fnmax_by_key<B, F>(self, f: F) ->Option<Self::Item>
where B:Ord, Self:Sized, F:FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from thespecified function.Read more
1.15.0 ·Source§

fnmax_by<F>(self, compare: F) ->Option<Self::Item>
where Self:Sized, F:FnMut(&Self::Item, &Self::Item) ->Ordering,

Returns the element that gives the maximum value with respect to thespecified comparison function.Read more
1.6.0 ·Source§

fnmin_by_key<B, F>(self, f: F) ->Option<Self::Item>
where B:Ord, Self:Sized, F:FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from thespecified function.Read more
1.15.0 ·Source§

fnmin_by<F>(self, compare: F) ->Option<Self::Item>
where Self:Sized, F:FnMut(&Self::Item, &Self::Item) ->Ordering,

Returns the element that gives the minimum value with respect to thespecified comparison function.Read more
1.0.0 ·Source§

fnunzip<A, B, FromA, FromB>(self) ->(FromA, FromB)
where FromA:Default +Extend<A>, FromB:Default +Extend<B>, Self:Sized +Iterator<Item =(A, B)>,

Converts an iterator of pairs into a pair of containers.Read more
1.36.0 ·Source§

fncopied<'a, T>(self) ->Copied<Self>
where T: 'a +Copy, Self:Sized +Iterator<Item =&'a T>,

Creates an iterator which copies all of its elements.Read more
1.0.0 ·Source§

fncloned<'a, T>(self) ->Cloned<Self>
where T: 'a +Clone, Self:Sized +Iterator<Item =&'a T>,

Creates an iterator whichclones all of its elements.Read more
1.0.0 ·Source§

fncycle(self) ->Cycle<Self>
where Self:Sized +Clone,

Repeats an iterator endlessly.Read more
Source§

fnarray_chunks<const N:usize>(self) ->ArrayChunks<Self, N>
where Self:Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator overN elements of the iterator at a time.Read more
1.11.0 ·Source§

fnsum<S>(self) -> S
where Self:Sized, S:Sum<Self::Item>,

Sums the elements of an iterator.Read more
1.11.0 ·Source§

fnproduct<P>(self) -> P
where Self:Sized, P:Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elementsRead more
Source§

fncmp_by<I, F>(self, other: I, cmp: F) ->Ordering
where Self:Sized, I:IntoIterator, F:FnMut(Self::Item, <I asIntoIterator>::Item) ->Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of thisIterator with thoseof another with respect to the specified comparison function.Read more
1.5.0 ·Source§

fnpartial_cmp<I>(self, other: I) ->Option<Ordering>
where I:IntoIterator, Self::Item:PartialOrd<<I asIntoIterator>::Item>, Self:Sized,

Lexicographically compares thePartialOrd elements ofthisIterator with those of another. The comparison works like short-circuitevaluation, returning a result without comparing the remaining elements.As soon as an order can be determined, the evaluation stops and a result is returned.Read more
Source§

fnpartial_cmp_by<I, F>(self, other: I, partial_cmp: F) ->Option<Ordering>
where Self:Sized, I:IntoIterator, F:FnMut(Self::Item, <I asIntoIterator>::Item) ->Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of thisIterator with thoseof another with respect to the specified comparison function.Read more
1.5.0 ·Source§

fneq<I>(self, other: I) ->bool
where I:IntoIterator, Self::Item:PartialEq<<I asIntoIterator>::Item>, Self:Sized,

Determines if the elements of thisIterator are equal to those ofanother.Read more
Source§

fneq_by<I, F>(self, other: I, eq: F) ->bool
where Self:Sized, I:IntoIterator, F:FnMut(Self::Item, <I asIntoIterator>::Item) ->bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of thisIterator are equal to those ofanother with respect to the specified equality function.Read more
1.5.0 ·Source§

fnne<I>(self, other: I) ->bool
where I:IntoIterator, Self::Item:PartialEq<<I asIntoIterator>::Item>, Self:Sized,

Determines if the elements of thisIterator are not equal to those ofanother.Read more
1.5.0 ·Source§

fnlt<I>(self, other: I) ->bool
where I:IntoIterator, Self::Item:PartialOrd<<I asIntoIterator>::Item>, Self:Sized,

Determines if the elements of thisIterator arelexicographicallyless than those of another.Read more
1.5.0 ·Source§

fnle<I>(self, other: I) ->bool
where I:IntoIterator, Self::Item:PartialOrd<<I asIntoIterator>::Item>, Self:Sized,

Determines if the elements of thisIterator arelexicographicallyless or equal to those of another.Read more
1.5.0 ·Source§

fngt<I>(self, other: I) ->bool
where I:IntoIterator, Self::Item:PartialOrd<<I asIntoIterator>::Item>, Self:Sized,

Determines if the elements of thisIterator arelexicographicallygreater than those of another.Read more
1.5.0 ·Source§

fnge<I>(self, other: I) ->bool
where I:IntoIterator, Self::Item:PartialOrd<<I asIntoIterator>::Item>, Self:Sized,

Determines if the elements of thisIterator arelexicographicallygreater than or equal to those of another.Read more
1.82.0 ·Source§

fnis_sorted_by<F>(self, compare: F) ->bool
where Self:Sized, F:FnMut(&Self::Item, &Self::Item) ->bool,

Checks if the elements of this iterator are sorted using the given comparator function.Read more
1.82.0 ·Source§

fnis_sorted_by_key<F, K>(self, f: F) ->bool
where Self:Sized, F:FnMut(Self::Item) -> K, K:PartialOrd,

Checks if the elements of this iterator are sorted using the given key extractionfunction.Read more

Auto Trait Implementations§

§

implFreeze forEncoded

§

implRefUnwindSafe forEncoded

§

implSend forEncoded

§

implSync forEncoded

§

implUnpin forEncoded

§

implUnwindSafe forEncoded

Blanket Implementations§

Source§

impl<T>Any for T
where T: 'static + ?Sized,

Source§

fntype_id(&self) ->TypeId

Gets theTypeId ofself.Read more
Source§

impl<T>Borrow<T> for T
where T: ?Sized,

Source§

fnborrow(&self) ->&T

Immutably borrows from an owned value.Read more
Source§

impl<T>BorrowMut<T> for T
where T: ?Sized,

Source§

fnborrow_mut(&mut self) ->&mut T

Mutably borrows from an owned value.Read more
Source§

impl<T>CloneToUninit for T
where T:Clone,

Source§

unsafe fnclone_to_uninit(&self, dest:*mutu8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment fromself todest.Read more
Source§

impl<T>From<T> for T

Source§

fnfrom(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U>Into<U> for T
where U:From<T>,

Source§

fninto(self) -> U

CallsU::from(self).

That is, this conversion is whatever the implementation ofFrom<T> for U chooses to do.

Source§

impl<I>IntoIterator for I
where I:Iterator,

Source§

typeItem = <I asIterator>::Item

The type of the elements being iterated over.
Source§

typeIntoIter = I

Which kind of iterator are we turning this into?
Source§

fninto_iter(self) -> I

Creates an iterator from a value.Read more
Source§

impl<T>ToOwned for T
where T:Clone,

Source§

typeOwned = T

The resulting type after obtaining ownership.
Source§

fnto_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning.Read more
Source§

fnclone_into(&self, target:&mut T)

Uses borrowed data to replace owned data, usually by cloning.Read more
Source§

impl<T, U>TryFrom<U> for T
where U:Into<T>,

Source§

typeError =Infallible

The type returned in the event of a conversion error.
Source§

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U>TryInto<U> for T
where U:TryFrom<T>,

Source§

typeError = <U asTryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>

Performs the conversion.

[8]ページ先頭

©2009-2025 Movatter.jp