#[repr(u8)]pub enum TriState {
NotAvailable = 126,
No = 78,
Yes = 89,
}Expand description
An enum for representing unknown, true, or false values. Equivalent to
Option<bool> but with a human-readable repr.
Variants§
Trait Implementations§
source§impl HasPyGilRef for TriState
impl HasPyGilRef for TriState
§type AsRefTarget = PyCell<TriState>
type AsRefTarget = PyCell<TriState>
Utility type to make Py::as_ref work.
source§impl IntoEnumIterator for TriState
impl IntoEnumIterator for TriState
type Iterator = TriStateIter
fn iter() -> TriStateIter ⓘ
source§impl PartialEq for TriState
impl PartialEq for TriState
source§impl PyClassImpl for TriState
impl PyClassImpl for TriState
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)]
§type ThreadChecker = SendablePyClass<TriState>
type ThreadChecker = SendablePyClass<TriState>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§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<TriState> for PyClassImplCollector<TriState>
Available on crate feature python only.
impl PyClassNewTextSignature<TriState> for PyClassImplCollector<TriState>
Available on crate feature
python only.fn new_text_signature(self) -> Option<&'static str>
source§impl PyMethods<TriState> for PyClassImplCollector<TriState>
Available on crate feature python only.
impl PyMethods<TriState> for PyClassImplCollector<TriState>
Available on crate feature
python only.fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for TriState
impl PyTypeInfo for TriState
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
👎Deprecated since 0.21.0:
PyTypeInfo::type_object will be replaced by PyTypeInfo::type_object_bound in a future PyO3 versionReturns the safe abstraction over the type object.
source§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
👎Deprecated since 0.21.0:
PyTypeInfo::is_type_of will be replaced by PyTypeInfo::is_type_of_bound in a future PyO3 versionChecks if
object is an instance of this type or a subclass of this type.source§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, 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
👎Deprecated since 0.21.0:
PyTypeInfo::is_exact_type_of will be replaced by PyTypeInfo::is_exact_type_of_bound in a future PyO3 versionChecks if
object is an instance of this type.source§impl TryFrom<u8> for TriState
impl TryFrom<u8> for TriState
§type Error = TryFromPrimitiveError<TriState>
type Error = TryFromPrimitiveError<TriState>
The type returned in the event of a conversion error.
source§impl TryFromPrimitive for TriState
impl TryFromPrimitive for TriState
impl Copy for TriState
impl Eq for TriState
impl StructuralPartialEq for TriState
Auto Trait Implementations§
impl Freeze for TriState
impl RefUnwindSafe for TriState
impl Send for TriState
impl Sync for TriState
impl Unpin for TriState
impl UnwindSafe for TriState
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