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§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>
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,
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)
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
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
Maximum encoded size of a work-package within the package limits: max_input(),
max_imports(), max_extrinsics() and max_dependencies(). Decode does not check these
limits (for example the authorization, the authorizer config and the work-item payloads are
plain Vec<u8>), so the bound holds only for a package that passed a check of them.
max_input() limits the authorization, the authorizer config, the work-item payloads, the
imported segments with their justifications and the extrinsic data together. Only the first
three are in the encoded package. The bound gives all of max_input() to them and also
counts max_imports() import specs, although each import uses part of max_input(). So
the bound is higher than the largest package, by the size of max_imports() import specs.
max_bundle_size() in jam-std-common relies on this: a bundle holds the imported
segments too.