Trait p2panda_rs::Validate

source ·
pub trait Validate {
    type Error: Debug + Error + Send + Sync + 'static;

    // Required method
    fn validate(&self) -> Result<(), Self::Error>;
}
Expand description

Trait used by p2panda structs to validate data formats.

Use this trait to check against (canonic) formats of data (like document ids or yasmf hashes) coming in via deserialization, constructors or (string) conversion.

Required Associated Types§

source

type Error: Debug + Error + Send + Sync + 'static

Validation error type.

Required Methods§

source

fn validate(&self) -> Result<(), Self::Error>

Validates p2panda data type instance.

Implementors§