pub struct UsageWatcher2SynchronousProxy { /* private fields */ }
Implementations§
Source§impl UsageWatcher2SynchronousProxy
impl UsageWatcher2SynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<UsageWatcher2Event, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<UsageWatcher2Event, 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: &Usage2,
state: &UsageState,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn on_state_changed( &self, usage: &Usage2, 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 From<Channel> for UsageWatcher2SynchronousProxy
impl From<Channel> for UsageWatcher2SynchronousProxy
Source§impl From<UsageWatcher2SynchronousProxy> for Handle
impl From<UsageWatcher2SynchronousProxy> for Handle
Source§fn from(value: UsageWatcher2SynchronousProxy) -> Self
fn from(value: UsageWatcher2SynchronousProxy) -> Self
Converts to this type from the input type.
Source§impl SynchronousProxy for UsageWatcher2SynchronousProxy
impl SynchronousProxy for UsageWatcher2SynchronousProxy
Source§type Proxy = UsageWatcher2Proxy
type Proxy = UsageWatcher2Proxy
The async proxy for the same protocol.
Source§type Protocol = UsageWatcher2Marker
type Protocol = UsageWatcher2Marker
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 UsageWatcher2SynchronousProxy
impl RefUnwindSafe for UsageWatcher2SynchronousProxy
impl Send for UsageWatcher2SynchronousProxy
impl Sync for UsageWatcher2SynchronousProxy
impl Unpin for UsageWatcher2SynchronousProxy
impl UnwindSafe for UsageWatcher2SynchronousProxy
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