Skip to main content

Instantiable

Struct Instantiable 

Source
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 str

The capability’s name in its unit (Kv).

§binding_prefix: &'static str

The 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: bool

Whether 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

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Instantiable

Source§

impl Debug for Instantiable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Instantiable

Source§

impl PartialEq for Instantiable

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Instantiable

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.