Struct LockedApp
pub struct LockedApp {
pub spin_lock_version: FixedVersionBackwardCompatible<1>,
pub must_understand: Vec<MustUnderstand>,
pub metadata: Map<String, Value>,
pub host_requirements: Map<String, Value>,
pub variables: BTreeMap<String, Variable>,
pub triggers: Vec<LockedTrigger>,
pub components: Vec<LockedComponent>,
}
Expand description
A LockedApp represents a “fully resolved” Spin application.
Fields§
§spin_lock_version: FixedVersionBackwardCompatible<1>
Locked schema version
must_understand: Vec<MustUnderstand>
Identifies fields in the LockedApp that the host must process if present.
metadata: Map<String, Value>
Application metadata
host_requirements: Map<String, Value>
Host requirements
variables: BTreeMap<String, Variable>
Custom config variables
triggers: Vec<LockedTrigger>
Application triggers
components: Vec<LockedComponent>
Application components
Implementations§
§impl LockedApp
impl LockedApp
pub fn from_json(contents: &[u8]) -> Result<LockedApp, Error>
pub fn from_json(contents: &[u8]) -> Result<LockedApp, Error>
Deserializes a LockedApp
from the given JSON data.
pub fn get_metadata<'this, T>(
&'this self,
key: MetadataKey<T>,
) -> Result<Option<T>, Error>where
T: Deserialize<'this>,
pub fn get_metadata<'this, T>(
&'this self,
key: MetadataKey<T>,
) -> Result<Option<T>, Error>where
T: Deserialize<'this>,
Deserializes typed metadata for this app.
Returns Ok(None)
if there is no metadata for the given key
and an
Err
only if there is a value for the key
but the typed
deserialization failed.
pub fn require_metadata<'this, T>(
&'this self,
key: MetadataKey<T>,
) -> Result<T, Error>where
T: Deserialize<'this>,
pub fn require_metadata<'this, T>(
&'this self,
key: MetadataKey<T>,
) -> Result<T, Error>where
T: Deserialize<'this>,
Deserializes typed metadata for this app.
Like LockedApp::get_metadata
, but returns an error if there is
no metadata for the given key
.
Trait Implementations§
§impl<'de> Deserialize<'de> for LockedApp
impl<'de> Deserialize<'de> for LockedApp
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LockedApp, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LockedApp, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for LockedApp
impl Serialize for LockedApp
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for LockedApp
impl RefUnwindSafe for LockedApp
impl Send for LockedApp
impl Sync for LockedApp
impl Unpin for LockedApp
impl UnwindSafe for LockedApp
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<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