Enum Fetch

Source
pub enum Fetch {
    WorkPackage,
    AuthCodeParam,
    AuthToken,
    AuthOutput,
    AnyPayload(usize),
    AnyExtrinsic {
        work_item: usize,
        index: usize,
    },
    OurExtrinsic(usize),
    AnyImport {
        work_item: usize,
        index: usize,
    },
    OurImport(usize),
}
Expand description

A definition of data to be fetched.

Variants§

§

WorkPackage

The current work-package.

§

AuthCodeParam

The parameterisation of the authorization code.

§

AuthToken

The input provided to the parameterized authorizer code.

§

AuthOutput

The output from the parameterized authorizer code.

§

AnyPayload(usize)

A given work-item’s payload.

§

AnyExtrinsic

A particular extrinsic of a given work-item.

Fields

§work_item: usize

The index of the work-item whose extrinsic should be fetched.

§index: usize

The index of the work-item’s extrinsic to be fetched.

§

OurExtrinsic(usize)

A particular extrinsic of the executing work-item.

§

AnyImport

A particular import-segment of a given work-item.

Fields

§work_item: usize

The index of the work-item whose import-segment should be fetched.

§index: usize

The index of the work-item’s import-segment to be fetched.

§

OurImport(usize)

A particular import-segment of the executing work-item.

Implementations§

Source§

impl Fetch

Source

pub fn fetch_into(self, target: &mut [u8], skip: usize) -> Option<usize>

Fetch the data defined by this Fetch into the given target buffer.

  • target: The buffer to write the fetched data into.
  • skip: The number of bytes to skip from the start of the data to be fetched.

Returns the full length of the data which is being fetched. If this is smaller than the target’s length, then some of the buffer will not be written to. If the request does not identify any data to be fetched (e.g. because an index is out of range) then returns None.

Source

pub fn len(self) -> Option<usize>

Fetch the length of the data defined by this Fetch.

Returns the length of the data which is being fetched. If the request does not identify any data to be fetched (e.g. because an index is out of range) then returns None.

Source

pub fn fetch(self) -> Option<Vec<u8>>

Fetch the data defined by this Fetch into a newly allocated Vec.

Returns a Vec containing the data identified by the value of self. If the request does not identify any data to be fetched (e.g. because an index is out of range) then returns None.

Trait Implementations§

Source§

impl Clone for Fetch

Source§

fn clone(&self) -> Fetch

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 Fetch

Source§

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

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

impl Copy for Fetch

Auto Trait Implementations§

§

impl Freeze for Fetch

§

impl RefUnwindSafe for Fetch

§

impl Send for Fetch

§

impl Sync for Fetch

§

impl Unpin for Fetch

§

impl UnwindSafe for Fetch

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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

Source§

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

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