Struct firefly_types::ShortMeta
source · pub struct ShortMeta<'a> {
pub app_id: &'a str,
pub author_id: &'a str,
}Expand description
A struct with only a few safe fields from Meta.
It is used to serialize information about an app outside of the app dir. Since it is outside, it escapes the hash and signature checks and so it must not store any information that must be verified before use.
Fields§
§app_id: &'a strImplementations§
source§impl<'a> ShortMeta<'a>
impl<'a> ShortMeta<'a>
sourcepub fn decode(s: &'a [u8]) -> Result<Self, Error>
pub fn decode(s: &'a [u8]) -> Result<Self, Error>
Load metadata from bytes generated by ShortMeta::encode.
§Errors
May return an error if the buffer does not contain valid metadata.
sourcepub fn encode<'b>(&self, buf: &'b mut [u8]) -> Result<&'b mut [u8], Error>
pub fn encode<'b>(&self, buf: &'b mut [u8]) -> Result<&'b mut [u8], Error>
Encode the matadata using the buffer.
The buffer is required to avoid allocations on the crate side.
Use ShortMeta::size to calculate the required buffer size.
§Errors
May return an error if the buffer is not big enough.
Trait Implementations§
source§impl<'de: 'a, 'a> Deserialize<'de> for ShortMeta<'a>
impl<'de: 'a, 'a> Deserialize<'de> for ShortMeta<'a>
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
source§impl<'a> PartialEq for ShortMeta<'a>
impl<'a> PartialEq for ShortMeta<'a>
impl<'a> Eq for ShortMeta<'a>
impl<'a> StructuralPartialEq for ShortMeta<'a>
Auto Trait Implementations§
impl<'a> Freeze for ShortMeta<'a>
impl<'a> RefUnwindSafe for ShortMeta<'a>
impl<'a> Send for ShortMeta<'a>
impl<'a> Sync for ShortMeta<'a>
impl<'a> Unpin for ShortMeta<'a>
impl<'a> UnwindSafe for ShortMeta<'a>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)