pub enum ReflectValueRef<'a> {
U32(u32),
U64(u64),
I32(i32),
I64(i64),
F32(f32),
F64(f64),
Bool(bool),
String(&'a str),
Bytes(&'a [u8]),
Enum(EnumDescriptor, i32),
Message(MessageRef<'a>),
}
Expand description
A reference to a value
Variants§
U32(u32)
u32
U64(u64)
u64
I32(i32)
i32
I64(i64)
i64
F32(f32)
f32
F64(f64)
f64
Bool(bool)
bool
String(&'a str)
string
Bytes(&'a [u8])
bytes
Enum(EnumDescriptor, i32)
enum
Tuple Fields
Message(MessageRef<'a>)
message
Implementations§
Source§impl<'a> ReflectValueRef<'a>
impl<'a> ReflectValueRef<'a>
Sourcepub fn get_type(&self) -> RuntimeType
pub fn get_type(&self) -> RuntimeType
Get type of this value.
Sourcepub fn to_enum_value(&self) -> Option<i32>
pub fn to_enum_value(&self) -> Option<i32>
Take enum value.
Sourcepub fn to_message(&self) -> Option<MessageRef<'a>>
pub fn to_message(&self) -> Option<MessageRef<'a>>
Take message value.
Sourcepub fn to_box(&self) -> ReflectValueBox
pub fn to_box(&self) -> ReflectValueBox
Clone to a box
Sourcepub fn downcast_clone<V: ProtobufValue>(&self) -> Result<V, Self>
pub fn downcast_clone<V: ProtobufValue>(&self) -> Result<V, Self>
Convert a value to arbitrary value.
Trait Implementations§
Source§impl<'a> Clone for ReflectValueRef<'a>
impl<'a> Clone for ReflectValueRef<'a>
Source§fn clone(&self) -> ReflectValueRef<'a>
fn clone(&self) -> ReflectValueRef<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for ReflectValueRef<'a>
impl<'a> Debug for ReflectValueRef<'a>
Source§impl<'a> Display for ReflectValueRef<'a>
impl<'a> Display for ReflectValueRef<'a>
Source§impl<'a> From<&'a [u8]> for ReflectValueRef<'a>
impl<'a> From<&'a [u8]> for ReflectValueRef<'a>
Source§impl<'a> From<&'a str> for ReflectValueRef<'a>
impl<'a> From<&'a str> for ReflectValueRef<'a>
Source§impl<'a> From<EnumValueDescriptor> for ReflectValueRef<'a>
impl<'a> From<EnumValueDescriptor> for ReflectValueRef<'a>
Source§fn from(v: EnumValueDescriptor) -> Self
fn from(v: EnumValueDescriptor) -> Self
Converts to this type from the input type.
Source§impl From<bool> for ReflectValueRef<'_>
impl From<bool> for ReflectValueRef<'_>
Source§impl From<f32> for ReflectValueRef<'_>
impl From<f32> for ReflectValueRef<'_>
Source§impl From<f64> for ReflectValueRef<'_>
impl From<f64> for ReflectValueRef<'_>
Source§impl From<i32> for ReflectValueRef<'_>
impl From<i32> for ReflectValueRef<'_>
Source§impl From<i64> for ReflectValueRef<'_>
impl From<i64> for ReflectValueRef<'_>
Source§impl From<u32> for ReflectValueRef<'_>
impl From<u32> for ReflectValueRef<'_>
Source§impl From<u64> for ReflectValueRef<'_>
impl From<u64> for ReflectValueRef<'_>
Source§impl<'a> Hash for ReflectValueRef<'a>
impl<'a> Hash for ReflectValueRef<'a>
Source§impl<'a> PartialEq<ReflectValueBox> for ReflectValueRef<'a>
impl<'a> PartialEq<ReflectValueBox> for ReflectValueRef<'a>
Source§impl<'a> PartialEq<ReflectValueRef<'a>> for ReflectValueBox
impl<'a> PartialEq<ReflectValueRef<'a>> for ReflectValueBox
Source§impl<'a> PartialEq for ReflectValueRef<'a>
impl<'a> PartialEq for ReflectValueRef<'a>
Source§impl<'a> ReflectEq for ReflectValueRef<'a>
impl<'a> ReflectEq for ReflectValueRef<'a>
Source§fn reflect_eq(&self, that: &Self, mode: &ReflectEqMode) -> bool
fn reflect_eq(&self, that: &Self, mode: &ReflectEqMode) -> bool
Perform the equality comparison.
Auto Trait Implementations§
impl<'a> !Freeze for ReflectValueRef<'a>
impl<'a> !RefUnwindSafe for ReflectValueRef<'a>
impl<'a> Send for ReflectValueRef<'a>
impl<'a> Sync for ReflectValueRef<'a>
impl<'a> Unpin for ReflectValueRef<'a>
impl<'a> !UnwindSafe for ReflectValueRef<'a>
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