pub struct ArgContiguousBytesLike(/* private fields */);Expand description
A bytes-like object asked for as PyBUF_CONTIG_RO, which is what a shape is
requested with rather than assumed.
Methods from Deref<Target = ArgBytesLike>§
pub fn borrow_buf(&self) -> BorrowedValue<'_, [u8]>
pub fn with_ref<F, R>(&self, f: F) -> R
Sourcepub fn borrow_buf_unlocked(
&self,
vm: &VirtualMachine,
) -> PyResult<UnlockedBuf<'_>>
pub fn borrow_buf_unlocked( &self, vm: &VirtualMachine, ) -> PyResult<UnlockedBuf<'_>>
The bytes to hand to an operation that may wait, and whatever keeps them readable while it does.
borrow_buf may answer with a lock that every other thread writing to
the same object waits on, and a thread waiting on a lock never reaches
a safepoint, so keeping one across a wait for a peer, a pipe or a
signal stops the world from being stopped at all. Bytes reached that
way are copied out first. Bytes that lock nothing – an immutable
object’s – are borrowed where they lie, which is all CPython holds in
either case.
pub fn len(&self) -> usize
Sourcepub fn itemsize(&self) -> usize
pub fn itemsize(&self) -> usize
The width of one item. Callers that read the buffer as bytes rather than as whatever it holds have to ask, since a contiguous buffer of wider items is contiguous all the same.
pub fn is_empty(&self) -> bool
pub fn as_object(&self) -> &PyObject
Sourcepub fn source_object(&self) -> &PyObject
pub fn source_object(&self) -> &PyObject
The object whose storage is borrowed while this buffer is read: a view borrows the object it looks at, not itself.
Trait Implementations§
Source§impl Debug for ArgContiguousBytesLike
impl Debug for ArgContiguousBytesLike
Source§impl Deref for ArgContiguousBytesLike
impl Deref for ArgContiguousBytesLike
Source§impl Traverse for ArgContiguousBytesLike
impl Traverse for ArgContiguousBytesLike
Source§fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
traverse() with caution! Following those guideline so traverse doesn’t cause memory error!: Read moreSource§fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
Source§impl<'a> TryFromBorrowedObject<'a> for ArgContiguousBytesLike
impl<'a> TryFromBorrowedObject<'a> for ArgContiguousBytesLike
Source§fn try_from_borrowed_object(
vm: &VirtualMachine,
obj: &'a PyObject,
) -> PyResult<Self>
fn try_from_borrowed_object( vm: &VirtualMachine, obj: &'a PyObject, ) -> PyResult<Self>
Auto Trait Implementations§
impl !Freeze for ArgContiguousBytesLike
impl !RefUnwindSafe for ArgContiguousBytesLike
impl !Send for ArgContiguousBytesLike
impl !Sync for ArgContiguousBytesLike
impl !UnwindSafe for ArgContiguousBytesLike
impl Unpin for ArgContiguousBytesLike
impl UnsafeUnpin for ArgContiguousBytesLike
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FromArgOptional for Twhere
T: TryFromObject,
impl<T> FromArgOptional for Twhere
T: TryFromObject,
Source§impl<T> FromArgs for Twhere
T: TryFromObject,
impl<T> FromArgs for Twhere
T: TryFromObject,
Source§fn arity() -> RangeInclusive<usize> ⓘ
fn arity() -> RangeInclusive<usize> ⓘ
Source§fn from_args(
vm: &VirtualMachine,
args: &mut FuncArgs,
) -> Result<T, ArgumentError>
fn from_args( vm: &VirtualMachine, args: &mut FuncArgs, ) -> Result<T, ArgumentError>
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more