pub struct WitWorld {
pub imports: HashSet<WitInterface>,
pub exports: HashSet<WitInterface>,
}Expand description
A collection of WIT interfaces representing a world definition.
A WIT world describes the imports and exports that a component or plugin provides. This is used for capability matching between workloads and plugins.
Fields§
§imports: HashSet<WitInterface>The interfaces that this world imports (requires from the host)
exports: HashSet<WitInterface>The interfaces that this world exports (provides to the host)
Implementations§
Source§impl WitWorld
impl WitWorld
Sourcepub fn includes(&self, interface: &WitInterface) -> bool
pub fn includes(&self, interface: &WitInterface) -> bool
This function checks if the world includes a specific interface. This is
slightly different than checking directly against the imports or exports
because it takes into account the possibility of interface nesting and
versioning. See WitInterface::contains for more details.
Sourcepub fn includes_bidirectional(&self, interface: &WitInterface) -> bool
pub fn includes_bidirectional(&self, interface: &WitInterface) -> bool
This function checks if the world includes a specific interface. This is
different than WitWorld::includes because it considers that in one
WitInterface there may be both imports and exports.
Sourcepub fn satisfies(&self, guest: &WitWorld) -> bool
pub fn satisfies(&self, guest: &WitWorld) -> bool
Checks if a guest world (imports) can be satisfied by a host world (exports).
A host world satisfies a guest world if all interfaces required by the guest are provided by the host, considering interface containment (subset/superset) and ignoring any additional interfaces or versions in the host.
§Arguments
guest- The guest world to check
§Returns
true if the host world (self) provides all interfaces required by the guest world
through direct exports or through superset relationships.
Trait Implementations§
impl Eq for WitWorld
impl StructuralPartialEq for WitWorld
Auto Trait Implementations§
impl Freeze for WitWorld
impl RefUnwindSafe for WitWorld
impl Send for WitWorld
impl Sync for WitWorld
impl Unpin for WitWorld
impl UnsafeUnpin for WitWorld
impl UnwindSafe for WitWorld
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