pub struct OCABundleModel {
pub version: String,
pub digest: Option<SelfAddressingIdentifier>,
pub capture_base: CaptureBase,
pub overlays: Vec<OverlayModel>,
pub attributes: Option<HashMap<String, Attribute>>,
}Fields§
§version: StringCESR version of the OCA Bundle with OCAS prefix
digest: Option<SelfAddressingIdentifier>§capture_base: CaptureBase§overlays: Vec<OverlayModel>§attributes: Option<HashMap<String, Attribute>>Implementations§
Source§impl OCABundleModel
impl OCABundleModel
pub fn new( capture_base: CaptureBase, overlays: Vec<OverlayModel>, ) -> OCABundleModel
pub fn fill_attributes(&mut self)
Sourcepub fn remove_attribute(&mut self, attr_name: &String)
pub fn remove_attribute(&mut self, attr_name: &String)
Remove attribute from the OCA Bundle if attribute does not exist, nothing will happen
pub fn get_attribute_by_name(&self, name: &str) -> Option<&Attribute>
Sourcepub fn compute_and_fill_digest(
&mut self,
) -> Result<SelfAddressingIdentifier, OCABundleSerializationError>
pub fn compute_and_fill_digest( &mut self, ) -> Result<SelfAddressingIdentifier, OCABundleSerializationError>
This method will compute digest for OCABundle and all it’s members (capture_base and each overlay) filling as well capture_base digest into overlays. It would use external structures instead of the internal Models i.e. OCABundle vs OCABundleModel Arguments:
self- OCABundleModel to compute digest for
Returns:
Result<said::SelfAddressingIdentifier, OCABundleSerializationError>- Result with computed SAID or an error if serialization or digest computation fails.
Trait Implementations§
Source§impl Clone for OCABundleModel
impl Clone for OCABundleModel
Source§fn clone(&self) -> OCABundleModel
fn clone(&self) -> OCABundleModel
Returns a duplicate of the value. Read more
1.0.0 · 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 OCABundleModel
impl Debug for OCABundleModel
Source§impl Default for OCABundleModel
impl Default for OCABundleModel
Source§fn default() -> OCABundleModel
fn default() -> OCABundleModel
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OCABundleModel
impl<'de> Deserialize<'de> for OCABundleModel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OCABundleModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OCABundleModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<OCABundleModel> for OCABundle
impl From<OCABundleModel> for OCABundle
Source§fn from(model: OCABundleModel) -> OCABundle
fn from(model: OCABundleModel) -> OCABundle
Converts to this type from the input type.
Source§impl From<OCABundleWithRegistry> for OCABundleModel
impl From<OCABundleWithRegistry> for OCABundleModel
Source§fn from(br: OCABundleWithRegistry) -> OCABundleModel
fn from(br: OCABundleWithRegistry) -> OCABundleModel
Converts to this type from the input type.
Source§impl Serialize for OCABundleModel
impl Serialize for OCABundleModel
Source§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
Source§impl ToJSON for OCABundleModel
impl ToJSON for OCABundleModel
fn get_json_bundle(&self) -> String
Source§impl WithInfo for OCABundleModel
impl WithInfo for OCABundleModel
fn info(&self) -> Arc<OCABundleInfo>
Auto Trait Implementations§
impl Freeze for OCABundleModel
impl RefUnwindSafe for OCABundleModel
impl Send for OCABundleModel
impl Sync for OCABundleModel
impl Unpin for OCABundleModel
impl UnsafeUnpin for OCABundleModel
impl UnwindSafe for OCABundleModel
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