fn check_valid_offset(&self, addr: u64, size: u64) -> Result<()> {
        if addr
            .checked_add(size)
            .filter(|end| *end <= self.size())
            .is_none()
        {
            return Err(ErrorKind::Overflow(addr).into());
        }
        Ok(())
    }
/// Check if the address(end address) overflows or exceeds the end of this region.
///
/// # Arguments
///
/// * `addr` - Start address.
/// * `size` - Size of memory segment.
///
/// # Errors
///
/// Return Error if the address overflows.
Check if the address(end address) overflows or exceeds the end of this region.
Check if the address ( end address ) overflows or exceeds the end of this region .
fn check_valid_offset(&self, addr: u64, size: u64) -> Result<()> {
        if addr
            .checked_add(size)
            .filter(|end| *end <= self.size())
            .is_none()
        {
            return Err(ErrorKind::Overflow(addr).into());
        }
        Ok(())
    }
fn check_valid_offset ( & self , addr : u64 , size : u64 ) -> Result < ( ) > { if addr . checked_add ( size ) . filter ( | end | * end <= self . size ( ) ) . is_none ( ) { return Err ( ErrorKind :: Overflow ( addr ) . into ( ) ) ; } Ok ( ( ) ) }
Check if the address(end address) overflows or exceeds the end of this region.
Check if the address ( end address ) overflows or exceeds the end of this region .
&self
addr
u64
size
u64
&self
addr
u64
size
u64
errors
Return Error if the address overflows.
Return Error if the address overflows .