Enum SeekFrom

enum SeekFrom

Enumeration of possible methods to seek within an I/O object.

It is used by the seek function.

This is similar to std::io::SeekFrom, however it adds platform-specific seek options.

Variants

Start(u64)

Sets the offset to the provided number of bytes.

End(i64)

Sets the offset to the size of this object plus the specified number of bytes.

It is possible to seek beyond the end of an object, but it's an error to seek before byte 0.

Current(i64)

Sets the offset to the current position plus the specified number of bytes.

It is possible to seek beyond the end of an object, but it's an error to seek before byte 0.

Data(u64)

Sets the offset to the current position plus the specified number of bytes, plus the distance to the next byte which is not in a hole.

If the offset is in a hole at the end of the file, the seek will fail with Errno::NXIO.

Hole(u64)

Sets the offset to the current position plus the specified number of bytes, plus the distance to the next byte which is in a hole.

If there is no hole past the offset, it will be set to the end of the file i.e. there is an implicit hole at the end of any file.

Implementations

impl Clone for SeekFrom

fn clone(self: &Self) -> SeekFrom

impl Copy for SeekFrom

impl Debug for SeekFrom

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for SeekFrom

impl Freeze for SeekFrom

impl PartialEq for SeekFrom

fn eq(self: &Self, other: &SeekFrom) -> bool

impl RefUnwindSafe for SeekFrom

impl Send for SeekFrom

impl StructuralPartialEq for SeekFrom

impl Sync for SeekFrom

impl Unpin for SeekFrom

impl UnsafeUnpin for SeekFrom

impl UnwindSafe for SeekFrom

impl<T> Any for SeekFrom

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for SeekFrom

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for SeekFrom

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for SeekFrom

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for SeekFrom

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for SeekFrom

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for SeekFrom

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for SeekFrom

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for SeekFrom

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>