pub struct WitInterface {
pub namespace: String,
pub package: String,
pub interfaces: HashSet<String>,
pub version: Option<Version>,
pub config: HashMap<String, String>,
}Expand description
Represents a WIT interface specification with namespace, package, and optional version.
A WitInterface identifies a specific set of interfaces from a WIT package.
It follows the format: namespace:package/interface1,interface2@version
where interfaces and version are optional.
§Examples
wasi:http- Just namespace and packagewasi:http/incoming-handler- With a single interfacewasi:http/incoming-handler,outgoing-handler@0.2.0- Multiple interfaces with version
Fields§
§namespace: StringThe namespace of the interface (e.g., “wasi”)
package: StringThe package name (e.g., “http”, “blobstore”)
interfaces: HashSet<String>The specific interfaces within the package (e.g., “incoming-handler”, “types”)
version: Option<Version>Optional semantic version for the interface
config: HashMap<String, String>Additional configuration parameters for this interface
Implementations§
Source§impl WitInterface
impl WitInterface
Sourcepub fn instance(&self) -> String
pub fn instance(&self) -> String
Returns the instance name of this WitInterface, aka the namespace:package@version identifier without the interfaces or config.
Sourcepub fn merge(&mut self, other: &WitInterface) -> bool
pub fn merge(&mut self, other: &WitInterface) -> bool
Merges another WitInterface into this one, returning a boolean
indicating whether the merge was successful (aka if the WitInterface::instances matched).
Sourcepub fn contains(&self, other: &WitInterface) -> bool
pub fn contains(&self, other: &WitInterface) -> bool
Checks if this interface contains (is a superset of) another interface.
This method is used to determine if a plugin or component that provides this interface can satisfy a requirement for the other interface.
§Arguments
other- The interface to check against
§Returns
true if:
- The namespace and package match exactly
- If this interface has a version, it must match the other’s version
- The other’s interfaces are a subset of this interface’s interfaces
Trait Implementations§
Source§impl Clone for WitInterface
impl Clone for WitInterface
Source§fn clone(&self) -> WitInterface
fn clone(&self) -> WitInterface
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WitInterface
impl Debug for WitInterface
Source§impl Display for WitInterface
impl Display for WitInterface
impl Eq for WitInterface
Source§impl From<&str> for WitInterface
impl From<&str> for WitInterface
Source§impl From<String> for WitInterface
impl From<String> for WitInterface
Source§impl Hash for WitInterface
impl Hash for WitInterface
Source§impl PartialEq for WitInterface
impl PartialEq for WitInterface
impl StructuralPartialEq for WitInterface
Auto Trait Implementations§
impl Freeze for WitInterface
impl RefUnwindSafe for WitInterface
impl Send for WitInterface
impl Sync for WitInterface
impl Unpin for WitInterface
impl UnsafeUnpin for WitInterface
impl UnwindSafe for WitInterface
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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,
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: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
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> ⓘ
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> ⓘ
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