pub struct UsageWatcherSynchronousProxy { /* private fields */ }
Implementations§
Source§impl UsageWatcherSynchronousProxy
impl UsageWatcherSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<UsageWatcherEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<UsageWatcherEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn on_state_changed(
&self,
usage: &Usage,
state: &UsageState,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn on_state_changed( &self, usage: &Usage, state: &UsageState, ___deadline: MonotonicInstant, ) -> Result<(), Error>
Called on first connection and whenever the watched usage changes. The provided usage will always be the bound usage; it is provided so that an implementation of this protocol may be bound to more than one usage.
Clients must respond to acknowledge the event. Clients that do not acknowledge their events will eventually be disconnected.
Trait Implementations§
Source§impl Debug for UsageWatcherSynchronousProxy
impl Debug for UsageWatcherSynchronousProxy
Source§impl SynchronousProxy for UsageWatcherSynchronousProxy
impl SynchronousProxy for UsageWatcherSynchronousProxy
Source§type Proxy = UsageWatcherProxy
type Proxy = UsageWatcherProxy
The async proxy for the same protocol.
Source§type Protocol = UsageWatcherMarker
type Protocol = UsageWatcherMarker
The protocol which this
Proxy
controls.Source§fn from_channel(inner: Channel) -> Self
fn from_channel(inner: Channel) -> Self
Create a proxy over the given channel.
Source§fn into_channel(self) -> Channel
fn into_channel(self) -> Channel
Convert the proxy back into a channel.
Source§fn as_channel(&self) -> &Channel
fn as_channel(&self) -> &Channel
Get a reference to the proxy’s underlying channel. Read more
Auto Trait Implementations§
impl Freeze for UsageWatcherSynchronousProxy
impl RefUnwindSafe for UsageWatcherSynchronousProxy
impl Send for UsageWatcherSynchronousProxy
impl Sync for UsageWatcherSynchronousProxy
impl Unpin for UsageWatcherSynchronousProxy
impl UnwindSafe for UsageWatcherSynchronousProxy
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