Skip to main content

PreparedNativeModule

Struct PreparedNativeModule 

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

One freshly prepared Module Instance generation returned by an Execution Adapter.

Implementations§

Source§

impl PreparedNativeModule

Source

pub fn new( endpoints: Vec<Rc<dyn NativeRequestEndpoint>>, lifecycle: impl ModuleLifecycle, ) -> Self

Creates one generation from its exact endpoint set and lifecycle Interface.

Source

pub fn with_lifecycle( endpoints: Vec<Rc<dyn NativeRequestEndpoint>>, lifecycle: Rc<dyn ModuleLifecycle>, ) -> Self

Creates one generation from an already shared lifecycle implementation.

Source

pub fn with_endpoints( endpoints: Vec<Rc<dyn NativeRequestEndpoint>>, stream_endpoints: Vec<Rc<dyn NativeStreamEndpoint>>, lifecycle: impl ModuleLifecycle, ) -> Self

Creates one generation with request and bidirectional stream endpoints.

Source

pub fn with_endpoint_set_lifecycle( endpoints: NativeEndpointSet, lifecycle: Rc<dyn ModuleLifecycle>, ) -> Self

Creates a generation from one complete endpoint set and shared lifecycle.

Source

pub fn with_stream_endpoints( stream_endpoints: Vec<Rc<dyn NativeStreamEndpoint>>, lifecycle: impl ModuleLifecycle, ) -> Self

Creates one generation containing only bidirectional stream endpoints.

Source

pub fn with_event_endpoints( event_endpoints: Vec<Rc<dyn NativeEventEndpoint>>, lifecycle: impl ModuleLifecycle, ) -> Self

Creates one generation containing only ephemeral Event endpoints.

Source

pub fn with_all_endpoints( endpoints: Vec<Rc<dyn NativeRequestEndpoint>>, stream_endpoints: Vec<Rc<dyn NativeStreamEndpoint>>, event_endpoints: Vec<Rc<dyn NativeEventEndpoint>>, lifecycle: impl ModuleLifecycle, ) -> Self

Creates one generation with request, stream, and ephemeral Event endpoints.

Source

pub fn endpoints(&self) -> &[Rc<dyn NativeRequestEndpoint>]

Returns the exact endpoints prepared for this generation.

Source

pub fn stream_endpoints(&self) -> &[Rc<dyn NativeStreamEndpoint>]

Returns the exact stream endpoints prepared for this generation.

Source

pub fn event_endpoints(&self) -> &[Rc<dyn NativeEventEndpoint>]

Returns the exact Event endpoints prepared for this generation.

Source

pub fn lifecycle(&self) -> Rc<dyn ModuleLifecycle>

Returns the lifecycle Interface prepared for this generation.

Trait Implementations§

Source§

impl Debug for PreparedNativeModule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.