INNER CODE UNIT · Rust
verify
CympleTech/ESSE · types/data/src/lib.rs:9
fn verify(&self, data: &Data<Self>) -> bool;
fn id_to_bytes(&self) -> Vec<u8>;
fn proof_to_bytes(proof: &Self::Proof) -> Vec<u8>;
fn id_from_bytes(id_bytes: &[u8]) -> Result<Self, ()>;
fn proof_from_bytes(proof_bytes: &[u8]) -> Result<Self::Proof, ()>;
}
/// common data structure.
#[derive(Clone, Eq, PartialEq)]
pub struct Data<T: OwnerId> {
/// Data unique ID, default generate method is other fields hash.
pub did: DataId,
/// ParentID, default is None.
pub pid: Option<DataId>,
/// time lifetime, (from, to) timestamp.
pub time: (i64, i64),
/// Owner's info.
pub owner: T,