Skip to main content

InputCapability

Struct InputCapability 

Source
pub struct InputCapability<T: Timestamp> { /* private fields */ }
Expand description

An capability of an input port.

Holding onto this capability will implicitly hold on to a capability for all the outputs ports this input is connected to, after the connection summaries have been applied.

This input capability supplies a retain_for_output(self) method which consumes the input capability and turns it into a Capability for a specific output port.

Implementations§

Source§

impl<T: Timestamp> InputCapability<T>

Source

pub fn stamp(&self) -> &Stamp<T>

The stamp of timestamps associated with the received message.

Source

pub fn least(&self) -> Option<&T>
where T: TotalOrder,

The least timestamp of the message’s stamp, if the stamp is non-empty.

This method exists only for totally ordered timestamps, where every non-empty stamp has a least element: the time at which the message may first result in downstream work, and the time at which to hold a capability for it. Partially ordered timestamps have no such element; operators over them must read the whole InputCapability::stamp and forward each of its elements.

Messages sent under no capabilities have an empty stamp and no least element. An operator that needs a time should if let Some(time) = cap.least() and drop such messages otherwise; they make no progress claims, and may arrive after the frontier has passed every time in their contents.

Source

pub fn delayed(&self, new_time: &T, output_port: usize) -> Capability<T>

Delays capability for a specific output port.

Makes a new capability for a timestamp new_time greater or equal to some element of the stamp of the source capability (self).

This method panics if no element of self.stamp() is less or equal to new_time.

Source

pub fn retain_least(&self, output_port: usize) -> Option<Capability<T>>
where T: TotalOrder,

Transforms to an owned capability for a specific output port.

This method produces an owned capability which must be dropped to release the capability. Users should take care that these capabilities are only stored for as long as they are required, as failing to drop them may result in livelock.

The capability is for the least element of the stamp, and so exists only for totally ordered timestamps; partially ordered timestamps must be retained with InputCapability::retain_stamp, which holds a capability for each element. An empty stamp yields no capability.

This method panics if the timestamp summary to output_port strictly advances the time.

Source

pub fn retain_stamp(&self, output_port: usize) -> CapabilitySet<T>

Transforms to an owned capability set for a specific output port, with one capability for each element of the message’s stamp.

An empty stamp produces an empty capability set. Data sent through a session keyed by an empty capability set makes no progress claims, and may be delivered after downstream frontiers have advanced past all times in its contents.

This method panics if the timestamp summary to output_port strictly advances any element of the stamp.

Trait Implementations§

Source§

impl<T: Timestamp> CapabilityTrait<T> for InputCapability<T>

Source§

fn stamp(&self) -> Stamp<T>

The stamp of timestamps to attach to messages sent with this capability. Read more
Source§

fn valid_for_output( &self, query_buffer: &Rc<RefCell<ChangeBatch<T>>>, port: usize, ) -> bool

Validates that the capability is valid for a specific internal buffer and output port.
Source§

impl<T: Timestamp> Debug for InputCapability<T>

Source§

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

Formats the value using the given formatter. 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<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, 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.