pub struct SoftBinding {
pub alg: String,
pub blocks: Vec<Block>,
pub name: Option<String>,
pub pad: Vec<u8>,
}Expand description
A soft-binding-map: one or more soft bindings over the asset’s content.
Field layout and names match the C2PA CDDL and the c2pa-rs reader. pad
is always emitted (an empty byte string) as the reference writer does.
Fields§
§alg: StringThe registered soft-binding algorithm identifier.
blocks: Vec<Block>One block per scoped soft-binding value.
name: Option<String>A human-readable description of what this binding covers.
pad: Vec<u8>Zero-filled padding; kept empty. Present to match the reference writer.
Implementations§
Source§impl SoftBinding
impl SoftBinding
Sourcepub fn whole(alg: &str, value_hex: String) -> Self
pub fn whole(alg: &str, value_hex: String) -> Self
A whole-asset soft binding: one block with an empty scope.
Sourcepub fn push_window(&mut self, start: usize, len: usize, value_hex: String)
pub fn push_window(&mut self, start: usize, len: usize, value_hex: String)
Push a block scoped to the character range [start, start+len) of the
normalized stream. Used to record the surface fingerprint’s windows.
Trait Implementations§
Source§impl Clone for SoftBinding
impl Clone for SoftBinding
Source§fn clone(&self) -> SoftBinding
fn clone(&self) -> SoftBinding
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 SoftBinding
impl Debug for SoftBinding
Source§impl<'de> Deserialize<'de> for SoftBinding
impl<'de> Deserialize<'de> for SoftBinding
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
impl Eq for SoftBinding
Source§impl PartialEq for SoftBinding
impl PartialEq for SoftBinding
Source§impl Serialize for SoftBinding
impl Serialize for SoftBinding
impl StructuralPartialEq for SoftBinding
Auto Trait Implementations§
impl Freeze for SoftBinding
impl RefUnwindSafe for SoftBinding
impl Send for SoftBinding
impl Sync for SoftBinding
impl Unpin for SoftBinding
impl UnsafeUnpin for SoftBinding
impl UnwindSafe for SoftBinding
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