Struct rustpython_vm::builtins::PyStr
source · pub struct PyStr { /* private fields */ }
Implementations§
Trait Implementations§
source§impl AsMapping for PyStr
impl AsMapping for PyStr
fn as_mapping() -> &'static PyMappingMethods
fn mapping_downcast(mapping: PyMapping<'_>) -> &Py<Self>
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl AsNumber for PyStr
impl AsNumber for PyStr
fn as_number() -> &'static PyNumberMethods
fn clone_exact(_zelf: &Py<Self>, _vm: &VirtualMachine) -> PyRef<Self>
fn number_downcast(num: PyNumber<'_>) -> &Py<Self>
fn number_downcast_exact(num: PyNumber<'_>, vm: &VirtualMachine) -> PyRef<Self>
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl AsSequence for PyStr
impl AsSequence for PyStr
fn as_sequence() -> &'static PySequenceMethods
fn sequence_downcast(seq: PySequence<'_>) -> &Py<Self>
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl Comparable for PyStr
impl Comparable for PyStr
fn cmp( zelf: &Py<Self>, other: &PyObject, op: PyComparisonOp, _vm: &VirtualMachine ) -> PyResult<PyComparisonValue>
fn slot_richcompare( zelf: &PyObject, other: &PyObject, op: PyComparisonOp, vm: &VirtualMachine ) -> PyResult<Either<PyObjectRef, PyComparisonValue>>
fn eq( zelf: &Py<Self>, other: PyObjectRef, vm: &VirtualMachine ) -> PyResult<PyComparisonValue>
fn ne( zelf: &Py<Self>, other: PyObjectRef, vm: &VirtualMachine ) -> PyResult<PyComparisonValue>
fn lt( zelf: &Py<Self>, other: PyObjectRef, vm: &VirtualMachine ) -> PyResult<PyComparisonValue>
fn le( zelf: &Py<Self>, other: PyObjectRef, vm: &VirtualMachine ) -> PyResult<PyComparisonValue>
fn ge( zelf: &Py<Self>, other: PyObjectRef, vm: &VirtualMachine ) -> PyResult<PyComparisonValue>
fn gt( zelf: &Py<Self>, other: PyObjectRef, vm: &VirtualMachine ) -> PyResult<PyComparisonValue>
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl Constructor for PyStr
impl Constructor for PyStr
type Args = StrArgs
fn py_new(cls: PyTypeRef, args: Self::Args, vm: &VirtualMachine) -> PyResult
fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl From<AsciiString> for PyStr
impl From<AsciiString> for PyStr
source§fn from(s: AsciiString) -> Self
fn from(s: AsciiString) -> Self
Converts to this type from the input type.
source§impl Hashable for PyStr
impl Hashable for PyStr
fn hash(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyHash>
fn slot_hash(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<PyHash>
fn __hash__(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyHash>
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl Iterable for PyStr
impl Iterable for PyStr
fn iter(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult
fn slot_iter(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult
fn __iter__(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult
fn extend_slots(_slots: &mut PyTypeSlots)
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl MaybeTraverse for PyStr
impl MaybeTraverse for PyStr
fn try_traverse(&self, tracer_fn: &mut TraverseFn<'_>)
source§impl PyClassDef for PyStr
impl PyClassDef for PyStr
source§impl PyClassImpl for PyStr
impl PyClassImpl for PyStr
const TP_FLAGS: PyTypeFlags = _
fn impl_extend_class(ctx: &Context, class: &'static Py<PyType>)
fn impl_extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn extend_slots(slots: &mut PyTypeSlots)
fn extend_class(ctx: &Context, class: &'static Py<PyType>)
fn make_class(ctx: &Context) -> PyTypeRefwhere Self: StaticType,
fn make_slots() -> PyTypeSlots
source§impl PyPayload for PyStr
impl PyPayload for PyStr
fn class(ctx: &Context) -> &'static Py<PyType>
fn into_pyobject(self, vm: &VirtualMachine) -> PyObjectRef
fn _into_ref(self, cls: PyTypeRef, ctx: &Context) -> PyRef<Self>
fn into_exact_ref(self, ctx: &Context) -> PyRefExact<Self>
fn into_ref(self, ctx: &Context) -> PyRef<Self>
fn into_ref_with_type( self, vm: &VirtualMachine, cls: PyTypeRef ) -> PyResult<PyRef<Self>>
source§impl Representable for PyStr
impl Representable for PyStr
fn repr_str(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<String>
fn slot_repr(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<PyStrRef>
fn __repr__(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyStrRef>
fn repr(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyStrRef>
fn __extend_method_def(method_defs: &mut Vec<PyMethodDef>)
fn __extend_py_class(ctx: &Context, class: &'static Py<PyType>)
fn __extend_slots(slots: &mut PyTypeSlots)
source§impl SliceableSequenceOp for PyStr
impl SliceableSequenceOp for PyStr
type Item = char
type Sliced = String
fn do_get(&self, index: usize) -> Self::Item
fn do_slice(&self, range: Range<usize>) -> Self::Sliced
fn do_slice_reverse(&self, range: Range<usize>) -> Self::Sliced
fn do_stepped_slice(&self, range: Range<usize>, step: usize) -> Self::Sliced
fn do_stepped_slice_reverse( &self, range: Range<usize>, step: usize ) -> Self::Sliced
fn empty() -> Self::Sliced
fn len(&self) -> usize
fn wrap_index(&self, p: isize) -> Option<usize>
fn saturate_index(&self, p: isize) -> usize
fn getitem_by_slice( &self, _vm: &VirtualMachine, slice: SaturatedSlice ) -> PyResult<Self::Sliced>
fn getitem_by_index( &self, vm: &VirtualMachine, index: isize ) -> PyResult<Self::Item>
source§impl StaticType for PyStr
impl StaticType for PyStr
fn static_cell() -> &'static StaticCell<PyTypeRef>
fn static_metaclass() -> &'static Py<PyType>
fn static_baseclass() -> &'static Py<PyType>
fn static_type() -> &'static Py<PyType>
fn init_manually(typ: PyTypeRef) -> &'static Py<PyType>
fn init_builtin_type() -> &'static Py<PyType>where Self: PyClassImpl,
fn create_static_type() -> PyTypeRefwhere Self: PyClassImpl,
source§impl ToCString for PyStr
impl ToCString for PyStr
fn to_cstring(&self, vm: &VirtualMachine) -> PyResult<CString>
Auto Trait Implementations§
impl !RefUnwindSafe for PyStr
impl Send for PyStr
impl !Sync for PyStr
impl Unpin for PyStr
impl UnwindSafe for PyStr
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