Struct linera_witty::hlist::HNil

source ·
pub struct HNil;
Expand description

Represents the right-most end of a heterogeneous list

§Examples

let h = h_cons(1, HNil);
let h = h.head;
assert_eq!(h, 1);

Implementations§

source§

impl HNil

source

pub fn len(&self) -> usize
where HNil: HList,

Returns the length of a given HList

§Examples
use frunk_core::hlist;

let h = hlist![1, "hi"];
assert_eq!(h.len(), 2);
source

pub fn is_empty(&self) -> bool
where HNil: HList,

Returns whether a given HList is empty

§Examples
use frunk_core::hlist;

let h = hlist![];
assert!(h.is_empty());
source

pub fn prepend<H>(self, h: H) -> HCons<H, HNil>
where HNil: HList,

Prepend an item to the current HList

§Examples
use frunk_core::hlist;

let h1 = hlist![1, "hi"];
let h2 = h1.prepend(true);
let (a, (b, c)) = h2.into_tuple2();
assert_eq!(a, true);
assert_eq!(b, 1);
assert_eq!(c, "hi");
source

pub fn sculpt<Ts, Indices>( self, ) -> (Ts, <HNil as Sculptor<Ts, Indices>>::Remainder)
where HNil: Sculptor<Ts, Indices>,

Consume the current HList and return an HList with the requested shape.

sculpt allows us to extract/reshape/sculpt the current HList into another shape, provided that the requested shape’s types are are contained within the current HList.

The Indices type parameter allows the compiler to figure out that Ts and Self can be morphed into each other.

§Examples
use frunk_core::{hlist, HList};

let h = hlist![9000, "joe", 41f32, true];
let (reshaped, remainder): (HList![f32, i32, &str], _) = h.sculpt();
assert_eq!(reshaped, hlist![41f32, 9000, "joe"]);
assert_eq!(remainder, hlist![true]);
source

pub fn into_reverse(self) -> <HNil as IntoReverse>::Output

Reverse the HList.

§Examples
use frunk_core::hlist;

assert_eq!(hlist![].into_reverse(), hlist![]);

assert_eq!(
    hlist![1, "hello", true, 42f32].into_reverse(),
    hlist![42f32, true, "hello", 1],
)
source

pub fn to_ref<'a>(&'a self) -> <HNil as ToRef<'a>>::Output
where HNil: ToRef<'a>,

Return an HList where the contents are references to the original HList on which this method was called.

§Examples
use frunk_core::hlist;

assert_eq!(hlist![].to_ref(), hlist![]);

assert_eq!(hlist![1, true].to_ref(), hlist![&1, &true]);
source

pub fn to_mut<'a>(&'a mut self) -> <HNil as ToMut<'a>>::Output
where HNil: ToMut<'a>,

Return an HList where the contents are mutable references to the original HList on which this method was called.

§Examples
use frunk_core::hlist;

assert_eq!(hlist![].to_mut(), hlist![]);

assert_eq!(hlist![1, true].to_mut(), hlist![&mut 1, &mut true]);
source

pub fn map<F>(self, mapper: F) -> <HNil as HMappable<F>>::Output
where HNil: HMappable<F>,

Apply a function to each element of an HList.

This transforms some HList![A, B, C, ..., E] into some HList![T, U, V, ..., Z]. A variety of types are supported for the folder argument:

  • An hlist![] of closures (one for each element).
  • A single closure (for mapping an HList that is homogenous).
  • A single Poly.
§Examples
use frunk::HNil;
use frunk_core::hlist;

assert_eq!(HNil.map(HNil), HNil);

let h = hlist![1, false, 42f32];

// Sadly we need to help the compiler understand the bool type in our mapper

let mapped = h.to_ref().map(hlist![
    |&n| n + 1,
    |b: &bool| !b,
    |&f| f + 1f32]);
assert_eq!(mapped, hlist![2, true, 43f32]);

// There is also a value-consuming version that passes values to your functions
// instead of just references:

let mapped2 = h.map(hlist![
    |n| n + 3,
    |b: bool| !b,
    |f| f + 8959f32]);
assert_eq!(mapped2, hlist![4, true, 9001f32]);
source

pub fn zip<Other>(self, other: Other) -> <HNil as HZippable<Other>>::Zipped
where HNil: HZippable<Other>,

Zip two HLists together.

This zips a HList![A1, B1, ..., C1] with a HList![A2, B2, ..., C2] to make a HList![(A1, A2), (B1, B2), ..., (C1, C2)]

§Example
use frunk::HNil;
use frunk_core::hlist;

assert_eq!(HNil.zip(HNil), HNil);

let h1 = hlist![1, false, 42f32];
let h2 = hlist![true, "foo", 2];

let zipped = h1.zip(h2);
assert_eq!(zipped, hlist![
    (1, true),
    (false, "foo"),
    (42f32, 2),
]);
source

pub fn foldl<Folder, Acc>( self, folder: Folder, acc: Acc, ) -> <HNil as HFoldLeftable<Folder, Acc>>::Output
where HNil: HFoldLeftable<Folder, Acc>,

Perform a left fold over an HList.

This transforms some HList![A, B, C, ..., E] into a single value by visiting all of the elements in left-to-right order. A variety of types are supported for the mapper argument:

  • An hlist![] of closures (one for each element).
  • A single closure (for folding an HList that is homogenous).
  • A single Poly.

The accumulator can freely change type over the course of the call. When called with a list of N functions, an expanded form of the implementation with type annotations might look something like this:

let acc: Acc0 = init_value;
let acc: Acc1 = f1(acc, x1);
let acc: Acc2 = f2(acc, x2);
let acc: Acc3 = f3(acc, x3);
...
let acc: AccN = fN(acc, xN);
acc
§Examples
use frunk_core::hlist;

let nil = hlist![];

assert_eq!(nil.foldl(hlist![], 0), 0);

let h = hlist![1, false, 42f32];

let folded = h.to_ref().foldl(
    hlist![
        |acc, &i| i + acc,
        |acc, b: &bool| if !b && acc > 42 { 9000f32 } else { 0f32 },
        |acc, &f| f + acc
    ],
    1
);

assert_eq!(42f32, folded);

// There is also a value-consuming version that passes values to your folding
// functions instead of just references:

let folded2 = h.foldl(
    hlist![
        |acc, i| i + acc,
        |acc, b: bool| if !b && acc > 42 { 9000f32 } else { 0f32 },
        |acc, f| f + acc
    ],
    8918
);

assert_eq!(9042f32, folded2)
source

pub fn foldr<Folder, Init>( self, folder: Folder, init: Init, ) -> <HNil as HFoldRightable<Folder, Init>>::Output
where HNil: HFoldRightable<Folder, Init>,

Perform a right fold over an HList.

This transforms some HList![A, B, C, ..., E] into a single value by visiting all of the elements in reverse order. A variety of types are supported for the mapper argument:

  • An hlist![] of closures (one for each element).
  • A single closure (for folding an HList that is homogenous), taken by reference.
  • A single Poly.

The accumulator can freely change type over the course of the call.

§Comparison to foldl

While the order of element traversal in foldl may seem more natural, foldr does have its use cases, in particular when it is used to build something that reflects the structure of the original HList (such as folding an HList of Options into an Option of an HList). An implementation of such a function using foldl will tend to reverse the list, while foldr will tend to preserve its order.

The reason for this is because foldr performs what is known as “structural induction;” it can be understood as follows:

  • Write out the HList in terms of h_cons and HNil.
  • Substitute each h_cons with a function, and substitute HNil with init
the list:
    h_cons(x1, h_cons(x2, h_cons(x3, ...h_cons(xN, HNil)...)))

becomes:
       f1( x1,    f2( x2,    f3( x3, ...   fN( xN, init)...)))
§Examples
use frunk_core::hlist;

let nil = hlist![];

assert_eq!(nil.foldr(hlist![], 0), 0);

let h = hlist![1, false, 42f32];

let folded = h.foldr(
    hlist![
        |acc, i| i + acc,
        |acc, b: bool| if !b && acc > 42f32 { 9000 } else { 0 },
        |acc, f| f + acc
    ],
    1f32
);

assert_eq!(9001, folded)
source

pub fn extend<Other>(self, other: Other) -> <HNil as Add<Other>>::Output
where HNil: Add<Other>, Other: HList,

Extend the contents of this HList with another HList

This exactly the same as the Add impl.

§Examples
use frunk_core::hlist;

let first = hlist![0u8, 1u16];
let second = hlist![2u32, 3u64];

assert_eq!(first.extend(second), hlist![0u8, 1u16, 2u32, 3u64]);

Trait Implementations§

source§

impl<RHS> Add<RHS> for HNil
where RHS: HList,

§

type Output = RHS

The resulting type after applying the + operator.
source§

fn add(self, rhs: RHS) -> RHS

Performs the + operation. Read more
source§

impl Clone for HNil

source§

fn clone(&self) -> HNil

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HNil

source§

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

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

impl Default for HNil

source§

fn default() -> HNil

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

impl From<()> for HNil

source§

fn from(_: ()) -> HNil

Converts to this type from the input type.
source§

impl<F, Acc> HFoldLeftable<F, Acc> for HNil

§

type Output = Acc

source§

fn foldl(self, _: F, acc: Acc) -> <HNil as HFoldLeftable<F, Acc>>::Output

Perform a left fold over an HList. Read more
source§

impl<F, Init> HFoldRightable<F, Init> for HNil

§

type Output = Init

source§

fn foldr(self, _: F, i: Init) -> <HNil as HFoldRightable<F, Init>>::Output

Perform a right fold over an HList. Read more
source§

impl<F, Init> HFoldRightableOwned<F, Init> for HNil

source§

fn real_foldr( self, f: F, i: Init, ) -> (<HNil as HFoldRightable<F, Init>>::Output, F)

source§

impl HList for HNil

source§

const LEN: usize = 0usize

Returns the length of a given HList type without making use of any references, or in fact, any values at all. Read more
source§

fn static_len() -> usize

👎Deprecated since 0.1.31: Please use LEN instead
Returns the length of a given HList type without making use of any references, or in fact, any values at all. Read more
source§

fn len(&self) -> usize

Returns the length of a given HList Read more
source§

fn is_empty(&self) -> bool

Returns whether a given HList is empty Read more
source§

fn prepend<H>(self, h: H) -> HCons<H, Self>

Prepends an item to the current HList Read more
source§

impl<F> HMappable<F> for HNil

§

type Output = HNil

source§

fn map(self, _: F) -> <HNil as HMappable<F>>::Output

Apply a function to each element of an HList. Read more
source§

impl HZippable<HNil> for HNil

§

type Zipped = HNil

source§

fn zip(self, _other: HNil) -> <HNil as HZippable<HNil>>::Zipped

Zip this HList with another one. Read more
source§

impl Hash for HNil

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Results, UserData> InstanceWithFunction<HNil, Results> for EntrypointInstance<UserData>
where Results: FlatLayout + WasmerResults, UserData: 'static,

§

type Function = TypedFunction<<HNil as WasmerParameters>::ImportParameters, <Results as WasmerResults>::Results>

The runtime-specific type to represent the function.
source§

fn function_from_export( &mut self, export: <Self::Runtime as Runtime>::Export, ) -> Result<Option<Self::Function>, RuntimeError>

Converts an export into a function, if it is one.
source§

fn call( &mut self, function: &Self::Function, $crate::hlist::HNil: HNil, ) -> Result<Results, RuntimeError>

Calls the function from this instance using the specified parameters.
source§

fn load_function(&mut self, name: &str) -> Result<Self::Function, RuntimeError>

Loads a function from the guest Wasm instance.
source§

impl<Results, UserData> InstanceWithFunction<HNil, Results> for ReentrantInstance<'_, UserData>
where Results: FlatLayout + WasmerResults, UserData: 'static,

§

type Function = TypedFunction<<HNil as WasmerParameters>::ImportParameters, <Results as WasmerResults>::Results>

The runtime-specific type to represent the function.
source§

fn function_from_export( &mut self, export: <Self::Runtime as Runtime>::Export, ) -> Result<Option<Self::Function>, RuntimeError>

Converts an export into a function, if it is one.
source§

fn call( &mut self, function: &Self::Function, $crate::hlist::HNil: HNil, ) -> Result<Results, RuntimeError>

Calls the function from this instance using the specified parameters.
source§

fn load_function(&mut self, name: &str) -> Result<Self::Function, RuntimeError>

Loads a function from the guest Wasm instance.
source§

impl<T> Into<Vec<T>> for HNil

source§

fn into(self) -> Vec<T>

Converts this type into the (usually inferred) input type.
source§

impl IntoReverse for HNil

§

type Output = HNil

source§

fn into_reverse(self) -> <HNil as IntoReverse>::Output

Reverses a given data structure.
source§

impl IntoUnlabelled for HNil

Implementation for HNil

§

type Output = HNil

source§

fn into_unlabelled(self) -> <HNil as IntoUnlabelled>::Output

Turns the current HList into an unlabelled one. Read more
source§

impl IntoValueLabelled for HNil

§

type Output = HNil

source§

fn into_value_labelled(self) -> <HNil as IntoValueLabelled>::Output

Turns the current HList into a value-labelled one. Read more
source§

impl<TargetHead, TargetTail> JoinFlatLayouts<HCons<TargetHead, TargetTail>> for HNil
where TargetHead: Default, HNil: JoinFlatLayouts<TargetTail>,

source§

fn into_joined(self) -> HCons<TargetHead, TargetTail>

Converts the current flat layout into a the joined Target flat layout.
source§

fn from_joined(_joined: HCons<TargetHead, TargetTail>) -> Self

Converts from the joined Target flat layout into the current flat layout.
source§

impl JoinFlatLayouts<HNil> for HNil

source§

fn into_joined(self) -> HNil

Converts the current flat layout into a the joined Target flat layout.
source§

fn from_joined(_joined: HNil) -> Self

Converts from the joined Target flat layout into the current flat layout.
source§

impl Layout for HNil

source§

const ALIGNMENT: u32 = 1u32

The alignment boundary required for the layout.
§

type Flat = HNil

Result of flattening this layout.
source§

fn flatten(self) -> Self::Flat

Flattens this layout into a layout consisting of native WebAssembly types. Read more
source§

impl<Head, Tail> Merge<HCons<Head, Tail>> for HNil
where HNil: Merge<Tail>,

§

type Output = HCons<Either<(), Head>, <HNil as Merge<Tail>>::Output>

The resulting heterogeneous list with elements of both input lists.
source§

impl<Head, Tail> Merge<HNil> for HCons<Head, Tail>
where Tail: Merge<HNil>,

§

type Output = HCons<Either<Head, ()>, <Tail as Merge<HNil>>::Output>

The resulting heterogeneous list with elements of both input lists.
source§

impl Merge<HNil> for HNil

§

type Output = HNil

The resulting heterogeneous list with elements of both input lists.
source§

impl Ord for HNil

source§

fn cmp(&self, other: &HNil) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for HNil

source§

fn eq(&self, other: &HNil) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for HNil

source§

fn partial_cmp(&self, other: &HNil) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl RegisterWitTypes for HNil

source§

fn register_wit_types(_wit_types: &mut BTreeMap<String, String>)

Registers this list of WitTypes into wit_types.
source§

impl Semigroup for HNil

Since () + () = (), the same is true for HNil

source§

fn combine(&self, _: &HNil) -> HNil

Associative operation taking which combines two values. Read more
source§

impl<'a> ToMut<'a> for HNil

§

type Output = HNil

source§

fn to_mut(&'a mut self) -> <HNil as ToMut<'a>>::Output

source§

impl<'a> ToRef<'a> for HNil

§

type Output = HNil

source§

fn to_ref(&'a self) -> <HNil as ToRef<'a>>::Output

source§

impl<SourceHead, SourceTail> Transmogrifier<HNil, HNil> for HCons<SourceHead, SourceTail>

Implementation of Transmogrifier for when the Target is empty and the Source is non-empty.

source§

fn transmogrify(self) -> HNil

Consume this current object and return an object of the Target type. Read more
source§

impl Transmogrifier<HNil, HNil> for HNil

Implementation of Transmogrifier for when the Target is empty and the Source is empty.

source§

fn transmogrify(self) -> HNil

Consume this current object and return an object of the Target type. Read more
source§

impl WasmerParameters for HNil

§

type ImportParameters = ()

The type Wasmer uses to represent the parameters in a function imported from a guest.
§

type ExportParameters = ()

The type Wasmer uses to represent the parameters in a function exported from a host.
source§

fn into_wasmer(self) -> Self::ImportParameters

Converts from this flat layout into Wasmer’s representation for functions imported from a guest.
source§

fn from_wasmer((): Self::ExportParameters) -> Self

Converts from Wasmer’s representation for functions exported from the host into this flat layout.
source§

impl WasmerResults for HNil

§

type Results = ()

The type Wasmer uses to represent the results.
source§

fn from_wasmer((): Self::Results) -> Self::Flat

Converts from Wasmer’s representation into a flat layout.
source§

fn into_wasmer(self) -> Self::Results

Converts from this flat layout into Wasmer’s representation.
source§

impl WasmtimeParameters for HNil

§

type Parameters = ()

The type Wasmtime uses to represent the parameters.
source§

fn into_wasmtime(self) -> Self::Parameters

Converts from this flat layout into Wasmtime’s representation.
source§

fn from_wasmtime((): Self::Parameters) -> Self

Converts from Wasmtime’s representation into a flat layout.
source§

impl WasmtimeResults for HNil

§

type Results = ()

The type Wasmtime uses to represent the results.
source§

fn from_wasmtime((): Self::Results) -> Self::Flat

Converts from Wasmtime’s representation into a flat layout.
source§

fn into_wasmtime(self) -> Self::Results

Converts from this flat layout into Wasmtime’s representation.
source§

impl WitLoad for HNil

source§

fn load<Instance>( _memory: &Memory<'_, Instance>, _location: GuestPointer, ) -> Result<Self, RuntimeError>
where Instance: InstanceWithMemory,

Loads an instance of the type from the location in the guest’s memory.
source§

fn lift_from<Instance>( HNil: <Self::Layout as Layout>::Flat, _memory: &Memory<'_, Instance>, ) -> Result<Self, RuntimeError>
where Instance: InstanceWithMemory,

Lifts an instance of the type from the flat_layout representation. Read more
source§

impl WitStore for HNil

source§

fn store<Instance>( &self, _memory: &mut Memory<'_, Instance>, _location: GuestPointer, ) -> Result<(), RuntimeError>
where Instance: InstanceWithMemory, <Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,

Stores the type at the location in the guest’s memory.
source§

fn lower<Instance>( &self, _memory: &mut Memory<'_, Instance>, ) -> Result<<Self::Layout as Layout>::Flat, RuntimeError>
where Instance: InstanceWithMemory, <Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,

Lowers the type into its flat layout representation. Read more
source§

impl WitType for HNil

source§

const SIZE: u32 = 0u32

The size of the type when laid out in memory.
§

type Layout = HNil

The layout of the type as fundamental types.
§

type Dependencies = HNil

Other WitTypes that this type depends on.
source§

fn wit_type_name() -> Cow<'static, str>

Generates the WIT type name for this type.
source§

fn wit_type_declaration() -> Cow<'static, str>

Generates the WIT type declaration for this type.
source§

impl Copy for HNil

source§

impl Eq for HNil

source§

impl StructuralPartialEq for HNil

Auto Trait Implementations§

§

impl Freeze for HNil

§

impl RefUnwindSafe for HNil

§

impl Send for HNil

§

impl Sync for HNil

§

impl Unpin for HNil

§

impl UnwindSafe for HNil

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> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<T> CallHasher for T
where T: Hash + ?Sized,

source§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

source§

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

§

type Remainder = Choices

source§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

source§

fn lift_into(self) -> U

Performs the indexed conversion.
source§

impl<T> MockResults for T

§

type Results = T

The mock native type of the results for the MockInstance.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<M, I> RuntimeMemory<&mut I> for M
where M: RuntimeMemory<I>,

source§

fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>

Reads length bytes from memory from the provided location.

source§

fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>

Writes the bytes to memory at the provided location.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<Source> Sculptor<HNil, HNil> for Source

§

type Remainder = Source

source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
source§

impl<AnyTail> Split<HNil> for AnyTail

§

type Remainder = AnyTail

The tail of remaining elements after splitting up the list.
source§

fn split(self) -> (HNil, <AnyTail as Split<HNil>>::Remainder)

Splits the current heterogeneous list in two.
source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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<T> Upcastable for T
where T: Any + Send + Sync + 'static,

source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more