pub struct WitInterfaceSpec {
pub namespace: WitNamespace,
pub package: WitPackage,
pub interfaces: Option<HashSet<WitInterface>>,
pub function: Option<WitFunction>,
pub version: Option<Version>,
}Expand description
String that represents a specification of a WIT interface (normally used when specifying InterfaceComponentOverrides)
Fields§
§namespace: WitNamespaceWIT namespace
package: WitPackageWIT package name
interfaces: Option<HashSet<WitInterface>>WIT interfaces, if omitted will be used to match any interface
function: Option<WitFunction>WIT interface function
version: Option<Version>Version of WIT interface
Implementations§
Source§impl WitInterfaceSpec
impl WitInterfaceSpec
Sourcepub fn includes(&self, other: &Self) -> bool
pub fn includes(&self, other: &Self) -> bool
Check whether this wit interface specification “contains” another one
Containing another WIT interface spec means the current interface (if loosely specified)
is more general than the other one.
This means that if the other spec is more general, this one will count as overlapping with it.
use std::str::FromStr;
use wash_lib::parser::WitInterfaceSpec;
assert!(WitInterfaceSpec::from_str("wasi:http").unwrap().includes(WitInterfaceSpec::from_str("wasi:http/incoming-handler").as_ref().unwrap()));
assert!(WitInterfaceSpec::from_str("wasi:http/incoming-handler").unwrap().includes(WitInterfaceSpec::from_str("wasi:http/incoming-handler.handle").as_ref().unwrap()));pub fn is_disjoint(&self, other: &Self) -> bool
Trait Implementations§
Source§impl Clone for WitInterfaceSpec
impl Clone for WitInterfaceSpec
Source§fn clone(&self) -> WitInterfaceSpec
fn clone(&self) -> WitInterfaceSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WitInterfaceSpec
impl Debug for WitInterfaceSpec
Source§impl<'de> Deserialize<'de> for WitInterfaceSpec
impl<'de> Deserialize<'de> for WitInterfaceSpec
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for WitInterfaceSpec
impl FromStr for WitInterfaceSpec
Source§impl PartialEq for WitInterfaceSpec
impl PartialEq for WitInterfaceSpec
impl Eq for WitInterfaceSpec
impl StructuralPartialEq for WitInterfaceSpec
Auto Trait Implementations§
impl Freeze for WitInterfaceSpec
impl RefUnwindSafe for WitInterfaceSpec
impl Send for WitInterfaceSpec
impl Sync for WitInterfaceSpec
impl Unpin for WitInterfaceSpec
impl UnwindSafe for WitInterfaceSpec
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> 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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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