pub struct LockedApp {
pub spin_lock_version: FixedVersion<0>,
pub metadata: 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: FixedVersion<0>
Locked schema version
metadata: Map<String, Value>
Application metadata
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 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
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self
file descriptor.