Skip to main content

Res

Struct Res 

Source
pub struct Res {
Show 14 fields pub template: Template, pub token: KindToken, pub annotations: BTreeMap<String, Value>, pub history: bool, pub frame: Option<FrameFacts>, pub packed: bool, pub block: bool, pub priority_data: bool, pub express: bool, pub longest_bytes: Option<u64>, pub link_v2: bool, pub epoch: Option<String>, pub tombstone_only: bool, pub cardinality: Option<u64>,
}
Expand description

One resource as the plan reads it: its template, its kind token, its resolved annotations, whether it declares history (core §2.5), and, for a frame resource (core §7.7), what the plan weighs of its frames; and what link.v2 reads of it (v2 §2.16, §2.17): whether its type is packed, whether its congestion is block, its longest put, and whether its contract lists link.v2.

Fields§

§template: Template§token: KindToken§annotations: BTreeMap<String, Value>§history: bool§frame: Option<FrameFacts>§packed: bool

Its type is packed (core §7.6); a frame resource’s always is. Read across revisions, packed only where every one types it packed (v2 §2.3).

§block: bool

Its congestion is block (core §2.4); across revisions, where any one declares it so.

§priority_data: bool

Its priority is data (core §2.4); across revisions, where every one declares it so. Another priority adds a QoS extension to the push and the frame (link.v1 §2.8).

§express: bool

It is express (core §2.4); across revisions, where any one is.

§longest_bytes: Option<u64>

Its longest put’s payload, in bytes: a packed record’s longest (every optional field present) after an ENVELOPE_BYTES envelope, or a frame resource’s largest frame. None for any other type. Across revisions, the longest of those that declare it block, or of every one where none does.

§link_v2: bool

The revision that declares it lists link.v2 (v2 §2.17).

§epoch: Option<String>

The parameter its template declares as its epoch (core §4.3), whose members hold member tokens: on a device face, epoch_on_device (v2 §2.5). Across revisions, any one’s.

§tombstone_only: bool

A state whose deletes only a tombstone proves (v2 §2.11, 0.9; core S3): a per-key resource (core §4.2), or a template whose first chunk is a parameter, which has no snapshot key. tombstone_only reads it; across revisions, where any one is.

§cardinality: Option<u64>

A templated resource’s cardinality (core §2.2), which an owner heartbeat’s longest put reads of a collection (v2 §2.16): None for a template with no parameter, and for a templated one that states none, read there as no ceiling. Across revisions, the largest any one states.

Implementations§

Source§

impl Res

Source

pub fn new( template: Template, token: KindToken, annotations: BTreeMap<String, Value>, ) -> Self

A resource of token at template, with resolved annotations, and nothing else stated: no history, no frame, a type that is not packed, drop at priority data and not express, no cardinality, in a revision that does not list link.v2 and uses no profile (tombstone_only).

Source

pub fn shape(&self) -> Shape

Its shape, as crossing_v2 reads it.

Source§

impl Res

Source

pub fn qos(&self) -> PutQos

What its QoS adds to its batch (link.v1 §2.8).

Source

pub fn of(c: &Contract, r: &Resource) -> Self

r of contract c, as the plan reads it.

Trait Implementations§

Source§

impl Clone for Res

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Res

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Res

§

impl Freeze for Res
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<Segment>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze,

§

impl Move for Res

§

impl RefUnwindSafe for Res

§

impl Send for Res
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for Res
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for Res
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for Res

§

impl UnwindSafe for Res
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: UnwindSafe,

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

Source§

fn as_node(&self) -> &T

Source§

impl<T> AsNodeMut<T> for T

Source§

fn as_node_mut(&mut self) -> &mut T

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.