pub struct ProviderProxy { /* private fields */ }
Implementations§
source§impl ProviderProxy
impl ProviderProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.memorypressure/Provider.
sourcepub fn take_event_stream(&self) -> ProviderEventStream
pub fn take_event_stream(&self) -> ProviderEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
sourcepub fn register_watcher(
&self,
watcher: ClientEnd<WatcherMarker>,
) -> Result<(), Error>
pub fn register_watcher( &self, watcher: ClientEnd<WatcherMarker>, ) -> Result<(), Error>
Used to register for memory pressure level changes.
watcher
: memory pressure Watcher
channel that the Provider
will use to send
level change messages to the client.
The current memory pressure level is immediately sent to the watcher when this method is called.
It is recommended that the root job in a component tree register for changes, rather than having individual jobs further down the tree register individually. A low client count will help minimize system churn due to a large number of memory pressure messages in transit at the same time. Also, the more context a job has, the better equipped it will be to react to memory pressure by controlling the behavior of children jobs in its tree.
Trait Implementations§
source§impl Clone for ProviderProxy
impl Clone for ProviderProxy
source§fn clone(&self) -> ProviderProxy
fn clone(&self) -> ProviderProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProviderProxy
impl Debug for ProviderProxy
source§impl ProviderProxyInterface for ProviderProxy
impl ProviderProxyInterface for ProviderProxy
fn register_watcher( &self, watcher: ClientEnd<WatcherMarker>, ) -> Result<(), Error>
source§impl Proxy for ProviderProxy
impl Proxy for ProviderProxy
§type Protocol = ProviderMarker
type Protocol = ProviderMarker
Proxy
controls.source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for ProviderProxy
impl !RefUnwindSafe for ProviderProxy
impl Send for ProviderProxy
impl Sync for ProviderProxy
impl Unpin for ProviderProxy
impl !UnwindSafe for ProviderProxy
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)