pub struct ResolvedRule {
pub specifier: String,
pub reference: RuleReference,
pub options: Option<Value>,
}Expand description
A rule reference, resolved, with the options it was configured with.
Fields§
§specifier: StringThe reference exactly as the config wrote it.
reference: RuleReferenceWhat it names.
options: Option<Value>The options it was configured with, as data.
None is the bare-string form — a rule used as it comes. Some is the object form,
including { "rule": "x" } with no options key, which configures it with null.
The distinction is the one a rule author already makes between a rule and a rule
factory, and it is not inferred from whether a value happens to be present.
A component cannot close over a host-supplied value the way a JavaScript factory does,
so crates/lanekeep-wasm/wit/world.wit declares configure(options-json) for exactly
that reason — a call made once after instantiation, taking this field serialized as
JSON (null for the bare-string form). crate::describe_components serializes it once
and records it with the rule, so the bytes every worker’s configure is handed are the
same bytes.
Trait Implementations§
Source§impl Clone for ResolvedRule
impl Clone for ResolvedRule
Source§fn clone(&self) -> ResolvedRule
fn clone(&self) -> ResolvedRule
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 ResolvedRule
impl Debug for ResolvedRule
impl Eq for ResolvedRule
Source§impl PartialEq for ResolvedRule
impl PartialEq for ResolvedRule
impl StructuralPartialEq for ResolvedRule
Auto Trait Implementations§
impl Freeze for ResolvedRule
impl RefUnwindSafe for ResolvedRule
impl Send for ResolvedRule
impl Sync for ResolvedRule
impl Unpin for ResolvedRule
impl UnsafeUnpin for ResolvedRule
impl UnwindSafe for ResolvedRule
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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> 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