pub struct ImportHandle { /* private fields */ }Expand description
A lazy, composition-bound handle for one declared import slot.
Clones retain the slot and ordered capability identities and observe the same eventual target seal. Until sealed, calls fail as unavailable.
Implementations§
Source§impl ImportHandle
impl ImportHandle
Sourcepub fn capabilities(&self) -> &[CapabilityId]
pub fn capabilities(&self) -> &[CapabilityId]
Returns allowed capability identities in declaration order.
Sourcepub fn call<'a>(
&'a self,
capability: &'a CapabilityId,
context: CallContext,
input: SlotValue,
) -> Pin<Box<dyn Future<Output = Result<SlotValue, ErasedCallError>> + Send + 'a>>
pub fn call<'a>( &'a self, capability: &'a CapabilityId, context: CallContext, input: SlotValue, ) -> Pin<Box<dyn Future<Output = Result<SlotValue, ErasedCallError>> + Send + 'a>>
Invokes a declared capability through the sealed import target.
Calls fail before provider invocation when the handle is unsealed, the
capability is undeclared, or the supplied deadline is already expired,
in that order. Provider panics are contained by the contract dispatch
boundary. The returned future is Send.
Trait Implementations§
Source§impl Clone for ImportHandle
impl Clone for ImportHandle
Source§fn clone(&self) -> ImportHandle
fn clone(&self) -> ImportHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ImportHandle
impl !UnwindSafe for ImportHandle
impl Freeze for ImportHandle
impl Send for ImportHandle
impl Sync for ImportHandle
impl Unpin for ImportHandle
impl UnsafeUnpin for ImportHandle
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