pub struct SeekFrom { /* private fields */ }
Expand description
The SeekFrom
struct is used to specify a position in a stream for seeking operations.
It combines a Whence
value with an offset.
Implementations§
Source§impl SeekFrom
impl SeekFrom
pub fn new(offset: i64, whence: Whence) -> Self
Sourcepub fn start(offset: u64) -> Self
pub fn start(offset: u64) -> Self
Creates a new SeekFrom
instance with Whence::Start
and the specified offset.
Sourcepub fn end(offset: i64) -> Self
pub fn end(offset: i64) -> Self
Creates a new SeekFrom
instance with Whence::End
and the specified offset.
Sourcepub fn current(offset: i64) -> Self
pub fn current(offset: i64) -> Self
Creates a new SeekFrom
instance with Whence::Current
and the specified offset.
pub fn __str__(&self) -> String
pub fn __repr__(&self) -> String
pub fn __eq__(&self, other: Self) -> bool
pub fn __ne__(&self, other: Self) -> bool
pub fn __hash__(&self) -> u64
Trait Implementations§
Source§impl PyClassImpl for SeekFrom
impl PyClassImpl for SeekFrom
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = SendablePyClass<SeekFrom>
type ThreadChecker = SendablePyClass<SeekFrom>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<SeekFrom> for PyClassImplCollector<SeekFrom>
impl PyClassNewTextSignature<SeekFrom> for PyClassImplCollector<SeekFrom>
fn new_text_signature(self) -> Option<&'static str>
Source§impl PyMethods<SeekFrom> for PyClassImplCollector<SeekFrom>
impl PyMethods<SeekFrom> for PyClassImplCollector<SeekFrom>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for SeekFrom
impl PyTypeInfo for SeekFrom
Source§type AsRefTarget = PyCell<SeekFrom>
type AsRefTarget = PyCell<SeekFrom>
Utility type to make Py::as_ref work.
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
Source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type or a subclass of this type.Source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.impl Copy for SeekFrom
impl Eq for SeekFrom
impl StructuralPartialEq for SeekFrom
Auto Trait Implementations§
impl Freeze for SeekFrom
impl RefUnwindSafe for SeekFrom
impl Send for SeekFrom
impl Sync for SeekFrom
impl Unpin for SeekFrom
impl UnwindSafe for SeekFrom
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more