pub struct ComponentInterfaces { /* private fields */ }Expand description
The exports and middleware status of a Wasm component, decoded once.
Decoding a component’s WIT is relatively expensive, so callers that need both
its exports and whether it is middleware should build a single
ComponentInterfaces and reuse it rather than re-inspecting the raw bytes.
Implementations§
Source§impl ComponentInterfaces
impl ComponentInterfaces
Sourcepub fn from_component(wasm_bytes: &[u8]) -> Result<Self>
pub fn from_component(wasm_bytes: &[u8]) -> Result<Self>
Decode a Wasm component and inspect its world’s imports and exports.
Sourcepub fn is_http_middleware(&self) -> bool
pub fn is_http_middleware(&self) -> bool
Whether the component is HTTP middleware.
Sourcepub fn exports(&self) -> &[String]
pub fn exports(&self) -> &[String]
The component’s exports, formatted as dependency-name strings.
Interface exports from a package are formatted as
namespace:package/interface@version. Exports declared with a bare name
(for example an exported function, or an inline interface) are returned as
that plain kebab-case name.
Auto Trait Implementations§
impl Freeze for ComponentInterfaces
impl RefUnwindSafe for ComponentInterfaces
impl Send for ComponentInterfaces
impl Sync for ComponentInterfaces
impl Unpin for ComponentInterfaces
impl UnsafeUnpin for ComponentInterfaces
impl UnwindSafe for ComponentInterfaces
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more