pub struct ArgumentList<Head, Rest> { /* private fields */ }
Expand description
An argument list.
This type is constructed mainly at compile type via type constructions to avoid having to allocate heap memory while constructing the encoded arguments. The potentially heap allocating encoding is done right at the end where we can leverage the static environmental buffer instead of allocating heap memory.
Implementations§
source§impl ArgumentList<ArgumentListEnd, ArgumentListEnd>
impl ArgumentList<ArgumentListEnd, ArgumentListEnd>
sourcepub fn empty() -> EmptyArgumentList
pub fn empty() -> EmptyArgumentList
Creates a new empty argument list.
sourcepub fn push_arg<T>(self, arg: T) -> ArgumentList<Argument<T>, Self>where
T: Encode,
pub fn push_arg<T>(self, arg: T) -> ArgumentList<Argument<T>, Self>where
T: Encode,
Pushes the first argument to the empty argument list.
source§impl<Head, Rest> ArgumentList<Argument<Head>, Rest>
impl<Head, Rest> ArgumentList<Argument<Head>, Rest>
sourcepub fn push_arg<T>(self, arg: T) -> ArgumentList<Argument<T>, Self>where
T: Encode,
pub fn push_arg<T>(self, arg: T) -> ArgumentList<Argument<T>, Self>where
T: Encode,
Pushes another argument to the argument list.
Trait Implementations§
source§impl<Head: Clone, Rest: Clone> Clone for ArgumentList<Head, Rest>
impl<Head: Clone, Rest: Clone> Clone for ArgumentList<Head, Rest>
source§fn clone(&self) -> ArgumentList<Head, Rest>
fn clone(&self) -> ArgumentList<Head, Rest>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Head: Default, Rest: Default> Default for ArgumentList<Head, Rest>
impl<Head: Default, Rest: Default> Default for ArgumentList<Head, Rest>
source§fn default() -> ArgumentList<Head, Rest>
fn default() -> ArgumentList<Head, Rest>
Returns the “default value” for a type. Read more
source§impl<Head, Rest> Encode for ArgumentList<Argument<Head>, Rest>where
Head: Encode,
Rest: Encode,
impl<Head, Rest> Encode for ArgumentList<Argument<Head>, Rest>where
Head: Encode,
Rest: Encode,
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<O: Output + ?Sized>(&self, output: &mut O)
fn encode_to<O: Output + ?Sized>(&self, output: &mut O)
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Auto Trait Implementations§
impl<Head, Rest> Freeze for ArgumentList<Head, Rest>
impl<Head, Rest> RefUnwindSafe for ArgumentList<Head, Rest>where
Head: RefUnwindSafe,
Rest: RefUnwindSafe,
impl<Head, Rest> Send for ArgumentList<Head, Rest>
impl<Head, Rest> Sync for ArgumentList<Head, Rest>
impl<Head, Rest> Unpin for ArgumentList<Head, Rest>
impl<Head, Rest> UnwindSafe for ArgumentList<Head, Rest>where
Head: UnwindSafe,
Rest: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.