pub trait ClientHook {
// Required methods
fn add_ref(&self) -> Box<dyn ClientHook>;
fn new_call(
&self,
interface_id: u64,
method_id: u16,
size_hint: Option<MessageSize>,
) -> Request<Owned, Owned>;
fn call(
&self,
interface_id: u64,
method_id: u16,
params: Box<dyn ParamsHook>,
results: Box<dyn ResultsHook>,
) -> Promise<(), Error> ⓘ;
fn get_brand(&self) -> usize;
fn get_ptr(&self) -> usize;
fn get_resolved(&self) -> Option<Box<dyn ClientHook>>;
fn when_more_resolved(&self) -> Option<Promise<Box<dyn ClientHook>, Error>>;
fn when_resolved(&self) -> Promise<(), Error> ⓘ;
}Required Methods§
fn add_ref(&self) -> Box<dyn ClientHook>
fn new_call( &self, interface_id: u64, method_id: u16, size_hint: Option<MessageSize>, ) -> Request<Owned, Owned>
fn call( &self, interface_id: u64, method_id: u16, params: Box<dyn ParamsHook>, results: Box<dyn ResultsHook>, ) -> Promise<(), Error> ⓘ
Sourcefn get_brand(&self) -> usize
fn get_brand(&self) -> usize
If this capability is associated with an rpc connection, then this method returns an identifier for that connection.
Sourcefn get_resolved(&self) -> Option<Box<dyn ClientHook>>
fn get_resolved(&self) -> Option<Box<dyn ClientHook>>
If this ClientHook is a promise that has already resolved, returns the inner, resolved version
of the capability. The caller may permanently replace this client with the resolved one if
desired. Returns null if the client isn’t a promise or hasn’t resolved yet – use
whenMoreResolved() to distinguish between them.
Sourcefn when_more_resolved(&self) -> Option<Promise<Box<dyn ClientHook>, Error>>
fn when_more_resolved(&self) -> Option<Promise<Box<dyn ClientHook>, Error>>
If this client is a settled reference (not a promise), return nullptr. Otherwise, return a
promise that eventually resolves to a new client that is closer to being the final, settled
client (i.e. the value eventually returned by getResolved()). Calling this repeatedly
should eventually produce a settled client.
Trait Implementations§
Source§impl Clone for Box<dyn ClientHook>
impl Clone for Box<dyn ClientHook>
Source§impl FromClientHook for Box<dyn ClientHook>
Available on crate feature alloc only.
impl FromClientHook for Box<dyn ClientHook>
alloc only.Source§fn new(hook: Box<dyn ClientHook>) -> Self
fn new(hook: Box<dyn ClientHook>) -> Self
Source§fn into_client_hook(self) -> Box<dyn ClientHook>
fn into_client_hook(self) -> Box<dyn ClientHook>
Source§fn as_client_hook(&self) -> &dyn ClientHook
fn as_client_hook(&self) -> &dyn ClientHook
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".