pub struct Instantiable {
pub capability: &'static str,
pub binding_prefix: &'static str,
pub options: &'static [(&'static str, OptionKind)],
pub required: &'static [&'static str],
pub bare: bool,
}Expand description
A capability a context may declare instances of (S4a, #1966, track D3).
Fields§
§capability: &'static strThe capability’s name in its unit (Kv).
binding_prefix: &'static strThe prefix of each instance’s Worker binding name: KV makes
capability Sessions = Kv bind as KV_SESSIONS.
options: &'static [(&'static str, OptionKind)]The creation options (@name(…)) an instance may carry, each with the
one literal its value is (standard-library P3, #2342: @worker("…")
takes a string, @limit(100) an Int, @period(60.seconds) a
Duration); any other is refused. Empty when the kind takes none yet.
required: &'static [&'static str]The options every instance must carry (interop I5, #1972): a
Service names the Worker it reaches, so it has no default. A subset
of Instantiable::options.
bare: boolWhether the base capability is usable bare, through given Kv, as
well as through instances. false for a kind whose every use needs an
option: a bare Service would name no Worker.
Implementations§
Source§impl Instantiable
impl Instantiable
Sourcepub fn option_kind(&self, name: &str) -> Option<OptionKind>
pub fn option_kind(&self, name: &str) -> Option<OptionKind>
The kind of literal option name takes, or None when it is not one
of this kind’s options.
Sourcepub fn option_names(&self) -> impl Iterator<Item = &'static str> + '_
pub fn option_names(&self) -> impl Iterator<Item = &'static str> + '_
The names of this kind’s options, in declaration order.
Trait Implementations§
Source§impl Clone for Instantiable
impl Clone for Instantiable
Source§fn clone(&self) -> Instantiable
fn clone(&self) -> Instantiable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more