Skip to main content

Orb

Struct Orb 

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

Native Orb declarations compile with the application and dispatch typed Rust callbacks.

Implementations§

Source§

impl Orb

Source

pub fn new(name: impl Into<String>, api_version: u32) -> Self

Create a native declaration with explicit identity and default options.

Source

pub fn declaration(&self) -> &Orb

Inspect this Orb’s declared services, signatures and requirements without installing it or running factories. Executable callbacks remain private.

Source

pub fn requires(self, requirement: Requirement) -> Self

Add an explicit versioned orb dependency.

Source

pub fn isolated(self) -> Self

Mark an executor-backed orb whose every revision owns a private resource realm.

Source

pub fn service<E>(self, service: Service<E>) -> Self

Attach a typed service and its callback implementation.

Source§

impl Orb

Source

pub fn create<T: 'static>( self, create: impl Fn(Declaration) -> Result<T> + 'static, ) -> Self

Create one shared environment for this orb and declare orb-owned resources and work.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Orb

§

impl !Send for Orb

§

impl !Sync for Orb

§

impl !UnwindSafe for Orb

§

impl Forget for Orb

§

impl Freeze for Orb

§

impl Move for Orb

§

impl Unpin for Orb

§

impl UnsafeUnpin for Orb

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.