pub struct StoreContent {
pub size: Option<Bytes>,
pub content_type: Option<String>,
pub reference: Option<RawFileRef>,
pub metadata: Option<HashMap<String, Value>>,
pub payment: Option<Payment>,
/* private fields */
}Fields§
§size: Option<Bytes>Size of the file. Generated by CCNs upon processing.
content_type: Option<String>Generated by CCNs upon processing.
reference: Option<RawFileRef>§metadata: Option<HashMap<String, Value>>Metadata of the VM.
payment: Option<Payment>Payment information for storage. Only hold and credit types are supported.
Implementations§
Source§impl StoreContent
impl StoreContent
pub fn new( file_hash: StorageBackend, reference: Option<RawFileRef>, metadata: Option<HashMap<String, Value>>, payment: Option<Payment>, ) -> Self
Sourcepub fn has_valid_payment(&self) -> bool
pub fn has_valid_payment(&self) -> bool
Returns true if the payment type is valid for a STORE message.
Only hold and credit are supported; superfluid is not allowed.
pub fn file_hash(&self) -> ItemHash
Trait Implementations§
Source§impl Clone for StoreContent
impl Clone for StoreContent
Source§fn clone(&self) -> StoreContent
fn clone(&self) -> StoreContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StoreContent
impl Debug for StoreContent
Source§impl<'de> Deserialize<'de> for StoreContent
impl<'de> Deserialize<'de> for StoreContent
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 PartialEq for StoreContent
impl PartialEq for StoreContent
Source§fn eq(&self, other: &StoreContent) -> bool
fn eq(&self, other: &StoreContent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for StoreContent
impl Serialize for StoreContent
impl StructuralPartialEq for StoreContent
Auto Trait Implementations§
impl Freeze for StoreContent
impl RefUnwindSafe for StoreContent
impl Send for StoreContent
impl Sync for StoreContent
impl Unpin for StoreContent
impl UnsafeUnpin for StoreContent
impl UnwindSafe for StoreContent
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