pub struct WrappedWorkPackage<W: Wrap> {
pub authorization: Authorization,
pub auth_code_host: ServiceId,
pub authorizer: Authorizer,
pub context: W::Wrap<RefineContext>,
pub items: W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>,
}Expand description
A work-package, a collection of work-items together with authorization and contextual information. This is processed in-core with Is-Authorized and Refine logic to produce a work-report.
The context and items fields are wrapped by W. Use WorkPackage if you want a plain
work-package struct.
Fields§
Authorization token.
auth_code_host: ServiceIdService identifier.
Authorizer.
context: W::Wrap<RefineContext>Refinement context.
items: W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>Sequence of work items.
Implementations§
Source§impl<W: Wrap> WrappedWorkPackage<W>
impl<W: Wrap> WrappedWorkPackage<W>
Sourcepub fn extrinsic_count(&self) -> u32
pub fn extrinsic_count(&self) -> u32
Returns the total number of extrinsics.
Sourcepub fn saturated_extrinsic_size(&self) -> u32
pub fn saturated_extrinsic_size(&self) -> u32
Returns the sum of the lengths of the package’s extrinsics.
Returns u32::MAX on overflow.
Sourcepub fn import_specs(&self) -> impl Iterator<Item = &ImportSpec>
pub fn import_specs(&self) -> impl Iterator<Item = &ImportSpec>
Returns an iterator over all of the import specs.
Sourcepub fn import_count(&self) -> u32
pub fn import_count(&self) -> u32
Returns the total number of imports.
Sourcepub fn export_count(&self) -> u32
pub fn export_count(&self) -> u32
Returns the total number of exports.
Sourcepub fn dependency_count(&self) -> u32
pub fn dependency_count(&self) -> u32
Returns the number of dependencies, including dependencies implied by indirect imports.
Trait Implementations§
Source§impl<W: Clone + Wrap> Clone for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Clone,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Clone,
impl<W: Clone + Wrap> Clone for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Clone,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Clone,
Source§fn clone(&self) -> WrappedWorkPackage<W>
fn clone(&self) -> WrappedWorkPackage<W>
Returns a duplicate 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<W: Debug + Wrap> Debug for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Debug,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Debug,
impl<W: Debug + Wrap> Debug for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Debug,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Debug,
Source§impl<W: Wrap> Decode for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Decode,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Decode,
impl<W: Wrap> Decode for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Decode,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Decode,
Source§fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
Attempt to deserialise the value from input.
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl<W: Wrap> Encode for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Encode,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Encode,
impl<W: Wrap> Encode for WrappedWorkPackage<W>where
W::Wrap<RefineContext>: Encode,
W::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Encode,
Source§fn encode_to<T: Output + ?Sized>(&self, dest: &mut T)
fn encode_to<T: Output + ?Sized>(&self, dest: &mut T)
Convert self to a slice and append it to the destination.
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 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.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl<W: Wrap> MaxEncodedLen for WrappedWorkPackage<W>where
Self: Encode,
impl<W: Wrap> MaxEncodedLen for WrappedWorkPackage<W>where
Self: Encode,
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Auto Trait Implementations§
impl<W> Freeze for WrappedWorkPackage<W>where
<W as Wrap>::Wrap<RefineContext>: Freeze,
<W as Wrap>::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Freeze,
impl<W> RefUnwindSafe for WrappedWorkPackage<W>where
<W as Wrap>::Wrap<RefineContext>: RefUnwindSafe,
<W as Wrap>::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: RefUnwindSafe,
impl<W> Send for WrappedWorkPackage<W>where
<W as Wrap>::Wrap<RefineContext>: Send,
<W as Wrap>::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Send,
impl<W> Sync for WrappedWorkPackage<W>where
<W as Wrap>::Wrap<RefineContext>: Sync,
<W as Wrap>::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Sync,
impl<W> Unpin for WrappedWorkPackage<W>where
<W as Wrap>::Wrap<RefineContext>: Unpin,
<W as Wrap>::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: Unpin,
impl<W> UnwindSafe for WrappedWorkPackage<W>where
<W as Wrap>::Wrap<RefineContext>: UnwindSafe,
<W as Wrap>::Wrap<BoundedVec<<W as Wrap>::Wrap<WorkItem>, MaxWorkItems>>: 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