Skip to main content

Ticks

Struct Ticks 

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

A body the domain produces a piece at a time.

Nothing here names a stream type. The domain states what a chunk is and how the next one is taken, and whichever interpretation carries the answer chooses how the bytes actually move.

Trait Implementations§

Source§

impl ChunksAlg for Ticks

Source§

type Chunk = Vec<u8>

What one chunk carries.
Source§

type Error = !

What a body failing part-way through means.
Source§

async fn next_chunk(&mut self) -> Option<Result<Self::Chunk, Self::Error>>

Takes the next chunk, or nothing where the body has ended.
Source§

impl Debug for Ticks

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

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

impl Default for Ticks

Source§

fn default() -> Ticks

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Ticks

§

impl RefUnwindSafe for Ticks

§

impl Send for Ticks

§

impl Sync for Ticks

§

impl Unpin for Ticks

§

impl UnsafeUnpin for Ticks

§

impl UnwindSafe for Ticks

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<This> ChunksExt<This> for This
where This: ChunksAlg + Send + 'static, <This as ChunksAlg>::Chunk: Send,

Source§

fn moving( self, ) -> impl Stream<Item = Result<<This as ChunksAlg>::Chunk, <This as ChunksAlg>::Error>>

Reads this body as the sequence of chunks it produces.

Nothing is converted and nothing is carried: a chunk stays what the domain said it was, and a failure stays what the domain said it meant. An interpretation states what to make of either, which is the only part of moving bytes that is its own.

Source§

async fn gathered( self, ) -> Result<Vec<<This as ChunksAlg>::Chunk>, <This as ChunksAlg>::Error>

Takes every chunk this body produces, in the order it produces them.

A sequence read whole is what anything states that cannot act on a piece at a time: a part’s content read into a value, or an answer compared against what a caller would have received.

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<This> HttpProgramExt<This> for This

Source§

fn compile_http<Program>( &self, program: Program, ) -> <Program as HttpProgramAlg<This>>::Route
where Program: HttpProgramAlg<This>,

Compiles a named HTTP program with this interpreter.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<This> LifecycleApiExt<This> for This

Source§

fn lifecycle_api<Alg>(&self) -> LifecycleApiProgram<Alg>
where Alg: ShopAlg + SlowAlg,

Declares one endpoint answering at once and one taking longer than any drain.

Source§

impl<This> MultipartApiExt<This> for This

Source§

fn multipart_api<Alg>(&self) -> MultipartApiProgram<Alg>
where Alg: UploadAlg,

Declares one endpoint reading a body that arrives as parts.

Source§

impl<This> ShapeProgramExt<This> for This

Source§

fn compile_shape<Program>( &self, program: Program, ) -> <Program as ShapeProgramAlg<This>>::Ty
where Program: ShapeProgramAlg<This>,

Folds a declaration with this interpretation.

Source§

impl<This> ShopApiExt<This> for This

Source§

fn shop_api<Alg>(&self) -> ShopApiProgram<Alg>
where Alg: ShopAlg,

Declares the surface every interpretation is held to.

Source§

impl<This> StreamApiExt<This> for This

Source§

fn stream_api<Alg>(&self) -> StreamApiProgram<Alg>
where Alg: TicksAlg,

Declares one endpoint answering with a body produced over time.

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<This> WideApiExt<This> for This

Source§

fn wide_api<Alg>(&self) -> WideApiProgram<Alg>
where Alg: WideAlg,

Declares one endpoint reading sixteen arguments.