Skip to main content

Owned

Struct Owned 

Source
pub struct Owned { /* private fields */ }
Expand description

An owned WIT resource handle held by native code. Dropping it is the WIT drop. It is not Clone. It closes its capability first and then releases its own admission claim.

Implementations§

Source§

impl Owned

Source

pub fn nominal(&self) -> &Nominal

Source

pub fn revision(&self) -> Id

Read the issuing provider revision retained through ownership transfers.

Source

pub async fn call_portable<A: IntoPayload + 'static, R: FromPayload + 'static>( &self, context: &Context, method: &str, arguments: A, ) -> Result<R>

Call a method of this resource. The call is admitted on this handle’s own claim with every ordinary kernel check. The handle travels only as the call’s implicit self loan.

Source

pub async fn issue_portable<A: IntoPayload + 'static, R: FromPayload + 'static>( &self, context: &Context, method: &str, arguments: A, ) -> Result<(IssuedCall, LocalBoxFuture<'static, Result<R>>)>

Like Owned::call_portable, with control of the admitted invocation: see crate::Reference::issue_portable.

Trait Implementations§

Source§

impl FromPayload for Owned

Source§

fn from_payload(payload: Payload, origin: &Origin) -> Result<Self>

A bare own result: the data names the only attachment.

Auto Trait Implementations§

§

impl !Freeze for Owned

§

impl !RefUnwindSafe for Owned

§

impl !Send for Owned

§

impl !Sync for Owned

§

impl !UnwindSafe for Owned

§

impl Forget for Owned

§

impl Move for Owned

§

impl Unpin for Owned

§

impl UnsafeUnpin for Owned

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.