Skip to main content

Reference

Struct Reference 

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

A claim is released on drop. A running callback has its own physical kernel pin.

Implementations§

Source§

impl Reference

Source

pub fn state_snapshot(&self) -> Result<(Snapshot, Value)>

Encode the provider’s current state through its portable boundary while this claim is live.

Source

pub fn id(&self) -> Id

Read this reference’s kernel identity.

Source

pub fn object(&self) -> Id

Read the object identity retained by this reference.

Source

pub fn release(&self) -> Result<()>

Release this ownership claim once.

Source

pub fn status(&self) -> Result<Status>

Read this claim’s lifecycle status, including deterministic release.

Source

pub async fn ready(&self) -> Result<()>

Waits for the kernel’s activation program, including every resource opener.

Source

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

Execute a typed local Rust call without requiring portable value traits. Arguments and results move as Rust values; nothing is serialized.

Source

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

Call the provider’s portable entrypoint, whatever language or isolation it has. JavaScript arguments use tuples or vectors to represent the method’s argument list. Results are decoded inside the managed call, so an owned capability that cannot be delivered is closed rather than leaked.

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 Reference::call_portable, but its caller keeps control of the admitted invocation: once admitted, it receives the IssuedCall, which cancels exactly this call and waits for its physical end, and the call’s result, which it may stop awaiting.

Source§

impl Reference

Source

pub fn state<T: 'static>(&self) -> Result<Readable<T>>

Read native typed state and bind all its observers to this claim’s lifetime.

Trait Implementations§

Source§

impl Drop for Reference

Source§

fn drop(&mut self)

Release an unconsumed reference claim during destruction.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

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.