pub struct Data {
pub handle: EventPair,
pub capabilities_proxy: CapabilitiesProxy,
}Expand description
A data capability holds a bit of static data which can be read back.
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 Data
impl Data
Sourcepub async fn new(value: DataValue) -> Self
pub async fn new(value: DataValue) -> Self
Creates a new Data, connecting to /svc/fuchsia.component.runtime.Capabilities to do
so.
Sourcepub async fn new_with_proxy(
capabilities_proxy: CapabilitiesProxy,
value: DataValue,
) -> Self
pub async fn new_with_proxy( capabilities_proxy: CapabilitiesProxy, value: DataValue, ) -> Self
Creates a new Data 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 get_value(&self) -> DataValue
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Data
impl !RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl !UnwindSafe for Data
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
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
Converts the given service transport handle of type
T to [Self]