pub struct LockedApp {
pub spin_lock_version: FixedVersionBackwardCompatible<1>,
pub must_understand: Vec<MustUnderstand>,
pub metadata: ValuesMap,
pub host_requirements: ValuesMap,
pub variables: LockedMap<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: ValuesMapApplication metadata
host_requirements: ValuesMapHost requirements
variables: LockedMap<Variable>Custom config variables
triggers: Vec<LockedTrigger>Application triggers
components: Vec<LockedComponent>Application components
Implementations§
Source§impl LockedApp
impl LockedApp
Sourcepub fn from_json(contents: &[u8]) -> Result<Self>
pub fn from_json(contents: &[u8]) -> Result<Self>
Deserializes a LockedApp from the given JSON data.
Sourcepub fn get_metadata<'this, T: Deserialize<'this>>(
&'this self,
key: MetadataKey<T>,
) -> Result<Option<T>>
pub fn get_metadata<'this, T: Deserialize<'this>>( &'this self, key: MetadataKey<T>, ) -> Result<Option<T>>
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.
Sourcepub fn require_metadata<'this, T: Deserialize<'this>>(
&'this self,
key: MetadataKey<T>,
) -> Result<T>
pub fn require_metadata<'this, T: Deserialize<'this>>( &'this self, key: MetadataKey<T>, ) -> Result<T>
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§
Source§impl<'de> Deserialize<'de> for LockedApp
impl<'de> Deserialize<'de> for LockedApp
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
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> 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