pub struct WitAnalysisContext { /* private fields */ }Implementations§
Source§impl WitAnalysisContext
impl WitAnalysisContext
pub fn new(component_bytes: &[u8]) -> AnalysisResult<WitAnalysisContext>
Sourcepub fn get_top_level_exports(&self) -> AnalysisResult<Vec<AnalysedExport>>
pub fn get_top_level_exports(&self) -> AnalysisResult<Vec<AnalysedExport>>
Get all top-level exports from the component with all the type information gathered from the component AST.
Sourcepub fn linear_memories(&self) -> &[MemoryType]
pub fn linear_memories(&self) -> &[MemoryType]
Gets all the linear memories defined in the component
pub fn producers(&self) -> &[Producers]
Sourcepub fn root_package_name(&self) -> Option<PackageName>
pub fn root_package_name(&self) -> Option<PackageName>
Gets the component’s root package name
Note that the root package name (from the original WIT) gets lost when encoding the component, so here we use the metadata custom section’s name and version fields in a Golem specific way to recover this information. These fields are set by Golem specific build tooling. If they are not present or not in a valid format, this function will return None.
Sourcepub fn serialized_interface_only(&self) -> AnalysisResult<Vec<u8>>
pub fn serialized_interface_only(&self) -> AnalysisResult<Vec<u8>>
Gets a binary WIT representation of the component’s interface
pub fn warnings(&self) -> Vec<AnalysisWarning>
Trait Implementations§
Source§impl GetResourceId for WitAnalysisContext
impl GetResourceId for WitAnalysisContext
fn get_resource_id(&self, type_id: TypeId) -> Option<AnalysedResourceId>
Auto Trait Implementations§
impl Freeze for WitAnalysisContext
impl !RefUnwindSafe for WitAnalysisContext
impl !Send for WitAnalysisContext
impl !Sync for WitAnalysisContext
impl Unpin for WitAnalysisContext
impl !UnwindSafe for WitAnalysisContext
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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