DocumentMethodsV0

Trait DocumentMethodsV0 

Source
pub trait DocumentMethodsV0 {
    // Required methods
    fn get_raw_for_contract(
        &self,
        key: &str,
        document_type_name: &str,
        contract: &DataContract,
        owner_id: Option<[u8; 32]>,
        platform_version: &PlatformVersion,
    ) -> Result<Option<Vec<u8>>, ProtocolError>;
    fn get_raw_for_document_type(
        &self,
        key_path: &str,
        document_type: DocumentTypeRef<'_>,
        owner_id: Option<[u8; 32]>,
        platform_version: &PlatformVersion,
    ) -> Result<Option<Vec<u8>>, ProtocolError>;
    fn hash(
        &self,
        contract: &DataContract,
        document_type: DocumentTypeRef<'_>,
        platform_version: &PlatformVersion,
    ) -> Result<Vec<u8>, ProtocolError>;
    fn increment_revision(&mut self) -> Result<(), ProtocolError>;
    fn is_equal_ignoring_time_based_fields(
        &self,
        rhs: &Self,
        also_ignore_fields: Option<Vec<&str>>,
        platform_version: &PlatformVersion,
    ) -> Result<bool, ProtocolError>;
}

Required Methods§

Source

fn get_raw_for_contract( &self, key: &str, document_type_name: &str, contract: &DataContract, owner_id: Option<[u8; 32]>, platform_version: &PlatformVersion, ) -> Result<Option<Vec<u8>>, ProtocolError>

Return a value given the path to its key and the document type for a contract.

Source

fn get_raw_for_document_type( &self, key_path: &str, document_type: DocumentTypeRef<'_>, owner_id: Option<[u8; 32]>, platform_version: &PlatformVersion, ) -> Result<Option<Vec<u8>>, ProtocolError>

Return a value given the path to its key for a document type.

Source

fn hash( &self, contract: &DataContract, document_type: DocumentTypeRef<'_>, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, ProtocolError>

Source

fn increment_revision(&mut self) -> Result<(), ProtocolError>

Source

fn is_equal_ignoring_time_based_fields( &self, rhs: &Self, also_ignore_fields: Option<Vec<&str>>, platform_version: &PlatformVersion, ) -> Result<bool, ProtocolError>

Checks to see if a document is equal without time based fields. Since these fields are set on the network this function can be useful to make sure that fields that were supplied have not changed, while ignoring those that are set network side. Time based fields that are ignored are created_at/updated_at created_at_block_height/updated_at_block_height created_at_core_block_height/updated_at_core_block_height

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§