pub fn calc_seek_offset_usize(cur_offset: usize, pos: isize, whence: usize, buf_len: usize) -> Result<isize> {
    let cur_offset = isize::try_from(cur_offset).or_else(|_| Err(Error::new(EOVERFLOW)))?;
    let buf_len = isize::try_from(buf_len).or_else(|_| Err(Error::new(EOVERFLOW)))?;
    calc_seek_offset_isize(cur_offset, pos, whence, buf_len)
}
/// Helper for seek calls
/// In most cases it's easier to use a usize to track the offset and buffer size internally,
/// but the seek interface uses isize.  This wrapper ensures EOVERFLOW errors are returned
/// as appropriate if the value in the usize can't fit in the isize.
Helper for seek calls
In most cases it's easier to use a usize to track the offset and buffer size internally,
but the seek interface uses isize.  This wrapper ensures EOVERFLOW errors are returned
as appropriate if the value in the usize can't fit in the isize.
Helper for seek calls In most cases it ' s easier to use a usize to track the offset and buffer size internally but the seek interface uses isize . This wrapper ensures EOVERFLOW errors are returned as appropriate if the value in the usize can ' t fit in the isize .
pub fn calc_seek_offset_usize(cur_offset: usize, pos: isize, whence: usize, buf_len: usize) -> Result<isize> {
    let cur_offset = isize::try_from(cur_offset).or_else(|_| Err(Error::new(EOVERFLOW)))?;
    let buf_len = isize::try_from(buf_len).or_else(|_| Err(Error::new(EOVERFLOW)))?;
    calc_seek_offset_isize(cur_offset, pos, whence, buf_len)
}
pub fn calc_seek_offset_usize ( cur_offset : usize , pos : isize , whence : usize , buf_len : usize ) -> Result < isize > { let cur_offset = isize :: try_from ( cur_offset ) . or_else ( | _ | Err ( Error :: new ( EOVERFLOW ) ) ) ? ; let buf_len = isize :: try_from ( buf_len ) . or_else ( | _ | Err ( Error :: new ( EOVERFLOW ) ) ) ? ; calc_seek_offset_isize ( cur_offset , pos , whence , buf_len ) }
Helper for seek calls
In most cases it's easier to use a usize to track the offset and buffer size internally,
but the seek interface uses isize.
Helper for seek calls In most cases it ' s easier to use a usize to track the offset and buffer size internally but the seek interface uses isize .
cur_offset
usize
pos
isize
whence
usize
buf_len
usize
cur_offset
usize
pos
isize
whence
usize
buf_len
usize