pub struct PyUtf8Str(/* private fields */);Implementations§
Trait Implementations§
Source§impl From<AsciiString> for PyUtf8Str
impl From<AsciiString> for PyUtf8Str
Source§fn from(s: AsciiString) -> Self
fn from(s: AsciiString) -> Self
Converts to this type from the input type.
Source§impl MaybeTraverse for PyUtf8Str
impl MaybeTraverse for PyUtf8Str
Source§const HAS_TRAVERSE: bool = true
const HAS_TRAVERSE: bool = true
if is traceable, will be used by vtable to determine
Source§const HAS_CLEAR: bool = false
const HAS_CLEAR: bool = false
if has clear implementation for circular reference resolution (tp_clear)
fn try_traverse(&self, traverse_fn: &mut TraverseFn<'_>)
fn try_clear(&mut self, _out: &mut Vec<PyObjectRef>)
Source§impl PyPayload for PyUtf8Str
impl PyPayload for PyUtf8Str
const PAYLOAD_TYPE_ID: TypeId
fn class(ctx: &Context) -> &'static Py<PyType>
fn try_downcast_from(obj: &PyObject, vm: &VirtualMachine) -> PyResult<()>
Source§const HAS_FREELIST: bool = false
const HAS_FREELIST: bool = false
Whether this type has a freelist. Types with freelists require
immediate (non-deferred) GC untracking during dealloc to prevent
race conditions when the object is reused.
Source§const MAX_FREELIST: usize = 0
const MAX_FREELIST: usize = 0
Maximum number of objects to keep in the freelist.
Source§unsafe fn freelist_push(_obj: *mut PyObject) -> bool
unsafe fn freelist_push(_obj: *mut PyObject) -> bool
Try to push a dead object onto this type’s freelist for reuse.
Returns true if the object was stored (caller must NOT free the memory).
Called before tp_clear, so the payload is still intact. Read more
Source§unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>>
unsafe fn freelist_pop(_payload: &Self) -> Option<NonNull<PyObject>>
Try to pop a pre-allocated object from this type’s freelist.
The returned pointer still has the old payload; the caller must
reinitialize
ref_count, gc_bits, and payload. Read morefn into_pyobject(self, vm: &VirtualMachine) -> PyObjectRefwhere
Self: Debug,
fn _into_ref(self, cls: PyTypeRef, ctx: &Context) -> PyRef<Self>where
Self: Debug,
fn into_exact_ref(self, ctx: &Context) -> PyRefExact<Self>where
Self: Debug,
fn into_ref(self, ctx: &Context) -> PyRef<Self>where
Self: Debug,
fn into_ref_with_type(
self,
vm: &VirtualMachine,
cls: PyTypeRef,
) -> PyResult<PyRef<Self>>where
Self: Debug,
Source§impl ToCString for PyUtf8Str
impl ToCString for PyUtf8Str
fn to_cstring(&self, vm: &VirtualMachine) -> PyResult<CString>
fn ensure_no_nul(&self, vm: &VirtualMachine) -> PyResult<()>
impl Eq for PyUtf8Str
Auto Trait Implementations§
impl !Freeze for PyUtf8Str
impl !RefUnwindSafe for PyUtf8Str
impl Send for PyUtf8Str
impl !Sync for PyUtf8Str
impl Unpin for PyUtf8Str
impl UnsafeUnpin for PyUtf8Str
impl UnwindSafe for PyUtf8Str
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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 moreSource§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
Source§impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)
Source§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
fn saturating_into(self) -> U
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more