Skip to main content

Contract

Struct Contract 

Source
pub struct Contract {
    pub plan: Plan,
    pub group_specs: Vec<GroupSpec>,
    pub field_addresses: Option<BTreeMap<String, u64>>,
    /* private fields */
}
Expand description

A rank’s cache transfer contract.

Fields§

§plan: Plan

The memory plan.

§group_specs: Vec<GroupSpec>

The groups’ semantics, in the scheduler’s order.

§field_addresses: Option<BTreeMap<String, u64>>

The fields’ landing addresses, on an endpoint’s contract; absent in the rank-independent bootstrap layout.

Implementations§

Source§

impl Contract

Source

pub fn from_wire(raw: &[u8]) -> Result<Self, LayoutError>

Parse a contract off the wire (CacheTransferContract.from_wire_bytes).

Source

pub fn new( plan: Plan, group_specs: Vec<GroupSpec>, partitions: Vec<(String, Partition)>, field_addresses: Option<BTreeMap<String, u64>>, ) -> Result<Self, LayoutError>

A contract from its parts, checked as the Python constructor checks it.

Source

pub fn without_addresses(&self) -> Self

The same contract without its landing addresses: the logical layout every rank of a node registers with the bootstrap server.

Source

pub fn group_spec(&self, group_id: &str) -> Result<&GroupSpec, LayoutError>

The group’s semantics.

Source

pub fn group(&self, group_id: &str) -> Result<&GroupLayout, LayoutError>

The group’s geometry.

Source

pub fn field(&self, field_id: &str) -> Result<&FieldLayout, LayoutError>

A field’s geometry.

Source

pub fn fields_for_group(&self, group_id: &str) -> Vec<&FieldLayout>

The group’s fields, sorted by field id (fields_for_group).

Source

pub fn shard_count(&self, group_id: &str) -> Result<i64, LayoutError>

The group’s cyclic owner count; one means replicated.

Source

pub fn virtual_block_count(&self, group_id: &str) -> Result<i64, LayoutError>

The exclusive bound of the scheduler block ids a manifest of the group may carry (virtual_block_count).

Source

pub fn partition_for(&self, field_id: &str) -> Option<&Partition>

A field’s TP partition, if it has one.

Source

pub fn field_page_byte_offset( &self, field_id: &str, page_id: i64, ) -> Result<i64, LayoutError>

One field page’s byte offset in the arena (field_page_byte_offset).

Source

pub fn field_address( &self, base: u64, field_id: &str, ) -> Result<i128, LayoutError>

Where a field’s page 0 lands for an arena at base: its advertised address on an endpoint’s contract, else base plus its offset.

Trait Implementations§

Source§

impl Clone for Contract

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 Contract

Source§

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

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

impl Eq for Contract

Source§

impl PartialEq for Contract

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

Auto Trait Implementations§

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<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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

Compares self with key and returns 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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