pub struct OwnerSteerBudget { /* private fields */ }Expand description
Moves an event-started turn onto the session’s budget once the owner’s own message is delivered into it (a steer): from then on someone is watching. Shared by the session actor (which sends the owner’s steer) and the turn’s stream (which drains steering). Sending an owner steer and draining steering hold the same lock, so the stream takes the budget in the very drain that delivers the owner’s message, never before it and never for an event or note steered into the same channel.
Implementations§
Source§impl OwnerSteerBudget
impl OwnerSteerBudget
Sourcepub fn send_owner_steer(
&self,
budget: TurnBudget,
send: impl FnOnce() -> bool,
) -> bool
pub fn send_owner_steer( &self, budget: TurnBudget, send: impl FnOnce() -> bool, ) -> bool
Session side: send the owner’s message into the turn; if it went in,
the turn takes budget when the stream delivers it.
Sourcepub fn drain<R>(&self, drain: impl FnOnce() -> R) -> (R, Option<TurnBudget>)
pub fn drain<R>(&self, drain: impl FnOnce() -> R) -> (R, Option<TurnBudget>)
Stream side: run drain (the steering drain) and return the budget
an owner message delivered by it, or by an earlier drain, carries.
Trait Implementations§
Source§impl Debug for OwnerSteerBudget
impl Debug for OwnerSteerBudget
Source§impl Default for OwnerSteerBudget
impl Default for OwnerSteerBudget
Source§fn default() -> OwnerSteerBudget
fn default() -> OwnerSteerBudget
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for OwnerSteerBudget
impl RefUnwindSafe for OwnerSteerBudget
impl Send for OwnerSteerBudget
impl Sync for OwnerSteerBudget
impl Unpin for OwnerSteerBudget
impl UnsafeUnpin for OwnerSteerBudget
impl UnwindSafe for OwnerSteerBudget
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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