pub enum WireValue {
Show 14 variants
Bool(bool),
Int(i64),
Double(f64),
String(String),
Ref(Ref),
IntList(Vec<i64>),
RefList(Vec<Ref>),
Device(Device),
Layout(Layout),
ScalarType(ScalarType),
MemoryFormat(MemoryFormat),
None(()),
PyObject(PickledPyObject),
IValue(OpaqueIValue),
}
Expand description
A value used as an input to CallFunction.
Variants§
Bool(bool)
Int(i64)
Double(f64)
String(String)
Ref(Ref)
IntList(Vec<i64>)
RefList(Vec<Ref>)
Device(Device)
Layout(Layout)
ScalarType(ScalarType)
MemoryFormat(MemoryFormat)
None(())
PyObject(PickledPyObject)
IValue(OpaqueIValue)
Implementations§
Source§impl WireValue
impl WireValue
Sourcepub fn as_bool_mut(&mut self) -> Option<&mut bool>
pub fn as_bool_mut(&mut self) -> Option<&mut bool>
Optionally returns mutable references to the inner fields if this is a WireValue::Bool
, otherwise None
Sourcepub fn as_bool(&self) -> Option<&bool>
pub fn as_bool(&self) -> Option<&bool>
Optionally returns references to the inner fields if this is a WireValue::Bool
, otherwise None
Sourcepub fn into_bool(self) -> Result<bool, Self>
pub fn into_bool(self) -> Result<bool, Self>
Returns the inner fields if this is a WireValue::Bool
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_int_mut(&mut self) -> Option<&mut i64>
pub fn as_int_mut(&mut self) -> Option<&mut i64>
Optionally returns mutable references to the inner fields if this is a WireValue::Int
, otherwise None
Sourcepub fn as_int(&self) -> Option<&i64>
pub fn as_int(&self) -> Option<&i64>
Optionally returns references to the inner fields if this is a WireValue::Int
, otherwise None
Sourcepub fn into_int(self) -> Result<i64, Self>
pub fn into_int(self) -> Result<i64, Self>
Returns the inner fields if this is a WireValue::Int
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_double_mut(&mut self) -> Option<&mut f64>
pub fn as_double_mut(&mut self) -> Option<&mut f64>
Optionally returns mutable references to the inner fields if this is a WireValue::Double
, otherwise None
Sourcepub fn as_double(&self) -> Option<&f64>
pub fn as_double(&self) -> Option<&f64>
Optionally returns references to the inner fields if this is a WireValue::Double
, otherwise None
Sourcepub fn into_double(self) -> Result<f64, Self>
pub fn into_double(self) -> Result<f64, Self>
Returns the inner fields if this is a WireValue::Double
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_string_mut(&mut self) -> Option<&mut String>
pub fn as_string_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a WireValue::String
, otherwise None
Sourcepub fn as_string(&self) -> Option<&String>
pub fn as_string(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a WireValue::String
, otherwise None
Sourcepub fn into_string(self) -> Result<String, Self>
pub fn into_string(self) -> Result<String, Self>
Returns the inner fields if this is a WireValue::String
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_ref_mut(&mut self) -> Option<&mut Ref>
pub fn as_ref_mut(&mut self) -> Option<&mut Ref>
Optionally returns mutable references to the inner fields if this is a WireValue::Ref
, otherwise None
Sourcepub fn as_ref(&self) -> Option<&Ref>
pub fn as_ref(&self) -> Option<&Ref>
Optionally returns references to the inner fields if this is a WireValue::Ref
, otherwise None
Sourcepub fn into_ref(self) -> Result<Ref, Self>
pub fn into_ref(self) -> Result<Ref, Self>
Returns the inner fields if this is a WireValue::Ref
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_int_list(&self) -> bool
pub fn is_int_list(&self) -> bool
Returns true if this is a WireValue::IntList
, otherwise false
Sourcepub fn as_int_list_mut(&mut self) -> Option<&mut Vec<i64>>
pub fn as_int_list_mut(&mut self) -> Option<&mut Vec<i64>>
Optionally returns mutable references to the inner fields if this is a WireValue::IntList
, otherwise None
Sourcepub fn as_int_list(&self) -> Option<&Vec<i64>>
pub fn as_int_list(&self) -> Option<&Vec<i64>>
Optionally returns references to the inner fields if this is a WireValue::IntList
, otherwise None
Sourcepub fn into_int_list(self) -> Result<Vec<i64>, Self>
pub fn into_int_list(self) -> Result<Vec<i64>, Self>
Returns the inner fields if this is a WireValue::IntList
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_ref_list(&self) -> bool
pub fn is_ref_list(&self) -> bool
Returns true if this is a WireValue::RefList
, otherwise false
Sourcepub fn as_ref_list_mut(&mut self) -> Option<&mut Vec<Ref>>
pub fn as_ref_list_mut(&mut self) -> Option<&mut Vec<Ref>>
Optionally returns mutable references to the inner fields if this is a WireValue::RefList
, otherwise None
Sourcepub fn as_ref_list(&self) -> Option<&Vec<Ref>>
pub fn as_ref_list(&self) -> Option<&Vec<Ref>>
Optionally returns references to the inner fields if this is a WireValue::RefList
, otherwise None
Sourcepub fn into_ref_list(self) -> Result<Vec<Ref>, Self>
pub fn into_ref_list(self) -> Result<Vec<Ref>, Self>
Returns the inner fields if this is a WireValue::RefList
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_device_mut(&mut self) -> Option<&mut Device>
pub fn as_device_mut(&mut self) -> Option<&mut Device>
Optionally returns mutable references to the inner fields if this is a WireValue::Device
, otherwise None
Sourcepub fn as_device(&self) -> Option<&Device>
pub fn as_device(&self) -> Option<&Device>
Optionally returns references to the inner fields if this is a WireValue::Device
, otherwise None
Sourcepub fn into_device(self) -> Result<Device, Self>
pub fn into_device(self) -> Result<Device, Self>
Returns the inner fields if this is a WireValue::Device
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_layout_mut(&mut self) -> Option<&mut Layout>
pub fn as_layout_mut(&mut self) -> Option<&mut Layout>
Optionally returns mutable references to the inner fields if this is a WireValue::Layout
, otherwise None
Sourcepub fn as_layout(&self) -> Option<&Layout>
pub fn as_layout(&self) -> Option<&Layout>
Optionally returns references to the inner fields if this is a WireValue::Layout
, otherwise None
Sourcepub fn into_layout(self) -> Result<Layout, Self>
pub fn into_layout(self) -> Result<Layout, Self>
Returns the inner fields if this is a WireValue::Layout
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_scalar_type(&self) -> bool
pub fn is_scalar_type(&self) -> bool
Returns true if this is a WireValue::ScalarType
, otherwise false
Sourcepub fn as_scalar_type_mut(&mut self) -> Option<&mut ScalarType>
pub fn as_scalar_type_mut(&mut self) -> Option<&mut ScalarType>
Optionally returns mutable references to the inner fields if this is a WireValue::ScalarType
, otherwise None
Sourcepub fn as_scalar_type(&self) -> Option<&ScalarType>
pub fn as_scalar_type(&self) -> Option<&ScalarType>
Optionally returns references to the inner fields if this is a WireValue::ScalarType
, otherwise None
Sourcepub fn into_scalar_type(self) -> Result<ScalarType, Self>
pub fn into_scalar_type(self) -> Result<ScalarType, Self>
Returns the inner fields if this is a WireValue::ScalarType
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_memory_format(&self) -> bool
pub fn is_memory_format(&self) -> bool
Returns true if this is a WireValue::MemoryFormat
, otherwise false
Sourcepub fn as_memory_format_mut(&mut self) -> Option<&mut MemoryFormat>
pub fn as_memory_format_mut(&mut self) -> Option<&mut MemoryFormat>
Optionally returns mutable references to the inner fields if this is a WireValue::MemoryFormat
, otherwise None
Sourcepub fn as_memory_format(&self) -> Option<&MemoryFormat>
pub fn as_memory_format(&self) -> Option<&MemoryFormat>
Optionally returns references to the inner fields if this is a WireValue::MemoryFormat
, otherwise None
Sourcepub fn into_memory_format(self) -> Result<MemoryFormat, Self>
pub fn into_memory_format(self) -> Result<MemoryFormat, Self>
Returns the inner fields if this is a WireValue::MemoryFormat
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_none_mut(&mut self) -> Option<&mut ()>
pub fn as_none_mut(&mut self) -> Option<&mut ()>
Optionally returns mutable references to the inner fields if this is a WireValue::None
, otherwise None
Sourcepub fn as_none(&self) -> Option<&()>
pub fn as_none(&self) -> Option<&()>
Optionally returns references to the inner fields if this is a WireValue::None
, otherwise None
Sourcepub fn into_none(self) -> Result<(), Self>
pub fn into_none(self) -> Result<(), Self>
Returns the inner fields if this is a WireValue::None
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_py_object(&self) -> bool
pub fn is_py_object(&self) -> bool
Returns true if this is a WireValue::PyObject
, otherwise false
Sourcepub fn as_py_object_mut(&mut self) -> Option<&mut PickledPyObject>
pub fn as_py_object_mut(&mut self) -> Option<&mut PickledPyObject>
Optionally returns mutable references to the inner fields if this is a WireValue::PyObject
, otherwise None
Sourcepub fn as_py_object(&self) -> Option<&PickledPyObject>
pub fn as_py_object(&self) -> Option<&PickledPyObject>
Optionally returns references to the inner fields if this is a WireValue::PyObject
, otherwise None
Sourcepub fn into_py_object(self) -> Result<PickledPyObject, Self>
pub fn into_py_object(self) -> Result<PickledPyObject, Self>
Returns the inner fields if this is a WireValue::PyObject
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_i_value(&self) -> bool
pub fn is_i_value(&self) -> bool
Returns true if this is a WireValue::IValue
, otherwise false
Sourcepub fn as_i_value_mut(&mut self) -> Option<&mut OpaqueIValue>
pub fn as_i_value_mut(&mut self) -> Option<&mut OpaqueIValue>
Optionally returns mutable references to the inner fields if this is a WireValue::IValue
, otherwise None
Sourcepub fn as_i_value(&self) -> Option<&OpaqueIValue>
pub fn as_i_value(&self) -> Option<&OpaqueIValue>
Optionally returns references to the inner fields if this is a WireValue::IValue
, otherwise None
Sourcepub fn into_i_value(self) -> Result<OpaqueIValue, Self>
pub fn into_i_value(self) -> Result<OpaqueIValue, Self>
Returns the inner fields if this is a WireValue::IValue
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WireValue
impl<'de> Deserialize<'de> for WireValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<MemoryFormat> for WireValue
impl From<MemoryFormat> for WireValue
Source§fn from(value: MemoryFormat) -> Self
fn from(value: MemoryFormat) -> Self
Source§impl From<OpaqueIValue> for WireValue
impl From<OpaqueIValue> for WireValue
Source§fn from(value: OpaqueIValue) -> Self
fn from(value: OpaqueIValue) -> Self
Source§impl From<PickledPyObject> for WireValue
impl From<PickledPyObject> for WireValue
Source§fn from(value: PickledPyObject) -> Self
fn from(value: PickledPyObject) -> Self
Source§impl From<ScalarType> for WireValue
impl From<ScalarType> for WireValue
Source§fn from(value: ScalarType) -> Self
fn from(value: ScalarType) -> Self
Source§impl FromPyObject<'_> for WireValue
impl FromPyObject<'_> for WireValue
Source§fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl Named for WireValue
impl Named for WireValue
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn arm(&self) -> Option<&'static str>
fn arm(&self) -> Option<&'static str>
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§impl TryFrom<WireValue> for MemoryFormat
impl TryFrom<WireValue> for MemoryFormat
Source§impl TryFrom<WireValue> for OpaqueIValue
impl TryFrom<WireValue> for OpaqueIValue
Source§impl TryFrom<WireValue> for PickledPyObject
impl TryFrom<WireValue> for PickledPyObject
Source§impl TryFrom<WireValue> for ScalarType
impl TryFrom<WireValue> for ScalarType
Source§impl<'py> TryIntoPyObjectUnsafe<'py, PyAny> for WireValue
impl<'py> TryIntoPyObjectUnsafe<'py, PyAny> for WireValue
unsafe fn try_to_object_unsafe( self, py: Python<'py>, ) -> PyResult<Bound<'py, PyAny>>
Auto Trait Implementations§
impl Freeze for WireValue
impl RefUnwindSafe for WireValue
impl Send for WireValue
impl Sync for WireValue
impl Unpin for WireValue
impl UnwindSafe for WireValue
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
Source§impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
Source§type State = T
type State = T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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