pub fn validate_region(region: &Region) -> RegionValidationResult<()> {
    if region.offset == 0 {
        return Err(RegionValidationError::zero_offset());
    }
    if region.length > region.capacity {
        return Err(RegionValidationError::length_exceeds_capacity(
            region.length,
            region.capacity,
        ));
    }
    if region.capacity > (u32::MAX - region.offset) {
        return Err(RegionValidationError::out_of_range(
            region.offset,
            region.capacity,
        ));
    }
    Ok(())
}
/// Performs plausibility checks in the given Region. Regions are always created by the
/// contract and this can be used to detect problems in the standard library of the contract.
Performs plausibility checks in the given Region. Regions are always created by the
contract and this can be used to detect problems in the standard library of the contract.
Performs plausibility checks in the given Region . Regions are always created by the contract and this can be used to detect problems in the standard library of the contract .
pub fn validate_region(region: &Region) -> RegionValidationResult<()> {
    if region.offset == 0 {
        return Err(RegionValidationError::zero_offset());
    }
    if region.length > region.capacity {
        return Err(RegionValidationError::length_exceeds_capacity(
            region.length,
            region.capacity,
        ));
    }
    if region.capacity > (u32::MAX - region.offset) {
        return Err(RegionValidationError::out_of_range(
            region.offset,
            region.capacity,
        ));
    }
    Ok(())
}
pub fn validate_region ( region : & Region ) -> RegionValidationResult < ( ) > { if region . offset == 0 { return Err ( RegionValidationError :: zero_offset ( ) ) ; } if region . length > region . capacity { return Err ( RegionValidationError :: length_exceeds_capacity ( region . length , region . capacity , ) ) ; } if region . capacity > ( u32 :: MAX - region . offset ) { return Err ( RegionValidationError :: out_of_range ( region . offset , region . capacity , ) ) ; } Ok ( ( ) ) }
Performs plausibility checks in the given Region.
Performs plausibility checks in the given Region .
region
&Region
region
&Region