pub struct DataRouter {
pub handle: EventPair,
pub capabilities_proxy: CapabilitiesProxy,
}Expand description
A data router may be used to request it produce a Data capability. The router may decide to
do so, decline to do so, or return an error, and it may rely on the contents of the metadata
provided when route is called to do so. Routers may also delegate the request to other
routers, often mutating metadata when they do.
Fields§
§handle: EventPairThe handle that references this capability
capabilities_proxy: CapabilitiesProxyThe proxy used to create this capability, and the proxy which will be used to perform operations on this capability.
Implementations§
Source§impl DataRouter
impl DataRouter
Sourcepub async fn new() -> (Self, DataRouterReceiver)
pub async fn new() -> (Self, DataRouterReceiver)
Creates a new DataRouter, connecting to /svc/fuchsia.component.runtime.Capabilities
to do so.
Sourcepub async fn new_with_proxy(
capabilities_proxy: CapabilitiesProxy,
) -> (Self, DataRouterReceiver)
pub async fn new_with_proxy( capabilities_proxy: CapabilitiesProxy, ) -> (Self, DataRouterReceiver)
Creates a new DataRouter using the provided capabilities_proxy.
Sourcepub async fn associate_with_handle(&self, other_handle: EventPair)
pub async fn associate_with_handle(&self, other_handle: EventPair)
Associates other_handle with the same object referenced by this capability, so that
whoever holds the other end of other_handle can refer to our capability.
pub async fn route( &self, request: RouteRequest, instance_token: &InstanceToken, ) -> Result<Option<Data>, Status>
Trait Implementations§
Source§impl Clone for DataRouter
impl Clone for DataRouter
Source§impl Debug for DataRouter
impl Debug for DataRouter
Source§impl From<DataRouter> for Capability
impl From<DataRouter> for Capability
Source§fn from(val: DataRouter) -> Self
fn from(val: DataRouter) -> Self
Source§impl TryFrom<Capability> for DataRouter
impl TryFrom<Capability> for DataRouter
Auto Trait Implementations§
impl Freeze for DataRouter
impl !RefUnwindSafe for DataRouter
impl Send for DataRouter
impl Sync for DataRouter
impl Unpin for DataRouter
impl !UnwindSafe for DataRouter
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§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]