pub struct EnumValue { /* private fields */ }
Implementations§
Source§impl EnumValue
impl EnumValue
pub fn new_struct_variant(name: impl Into<String>) -> StructVariantBuilder
pub fn new_struct_variant_with_capacity( name: impl Into<String>, capacity: usize, ) -> StructVariantBuilder
pub fn new_tuple_variant(name: impl Into<String>) -> TupleVariantBuilder
pub fn new_tuple_variant_with_capacity( name: impl Into<String>, capacity: usize, ) -> TupleVariantBuilder
pub fn new_unit_variant(name: impl Into<String>) -> Self
pub fn with_struct_field( self, name: impl Into<String>, value: impl Into<Value>, ) -> Self
pub fn with_tuple_field(self, value: impl Into<Value>) -> Self
pub fn set_struct_field( &mut self, name: impl Into<String>, value: impl Into<Value>, )
pub fn push_tuple_field(&mut self, value: impl Into<Value>)
Trait Implementations§
Source§impl DescribeType for EnumValue
impl DescribeType for EnumValue
Source§impl<'de> Deserialize<'de> for EnumValue
impl<'de> Deserialize<'de> for EnumValue
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Enum for EnumValue
impl Enum for EnumValue
fn variant_name(&self) -> &str
fn variant_kind(&self) -> VariantKind
fn field(&self, name: &str) -> Option<&dyn Reflect>
fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>
fn field_at(&self, index: usize) -> Option<&dyn Reflect>
fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>
fn fields(&self) -> VariantFieldIter<'_> ⓘ
fn fields_mut(&mut self) -> VariantFieldIterMut<'_> ⓘ
fn variants_len(&self) -> usize
fn fields_len(&self) -> usize
fn name_at(&self, index: usize) -> Option<&str>
Source§impl FromReflect for EnumValue
impl FromReflect for EnumValue
fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
Source§impl Ord for EnumValue
impl Ord for EnumValue
Source§impl PartialOrd for EnumValue
impl PartialOrd for EnumValue
Source§impl<'a_, C_: Context> Readable<'a_, C_> for EnumValue
impl<'a_, C_: Context> Readable<'a_, C_> for EnumValue
fn read_from<R_: Reader<'a_, C_>>(_reader_: &mut R_) -> Result<Self, C_::Error>
fn minimum_bytes_needed() -> usize
Source§fn read_from_buffer(buffer: &'a [u8]) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn read_from_buffer(buffer: &'a [u8]) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
Deserializes from a given buffer. Read more
Source§fn read_with_length_from_buffer(
buffer: &'a [u8],
) -> (Result<Self, <C as Context>::Error>, usize)where
Self: DefaultContext<Context = C>,
C: Default,
fn read_with_length_from_buffer(
buffer: &'a [u8],
) -> (Result<Self, <C as Context>::Error>, usize)where
Self: DefaultContext<Context = C>,
C: Default,
Deserializes from a given buffer while also returning the amount of bytes consumed. Read more
Source§fn read_from_buffer_copying_data(
buffer: &[u8],
) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn read_from_buffer_copying_data(
buffer: &[u8],
) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
Deserializes from a given buffer. Read more
Source§fn read_with_length_from_buffer_copying_data(
buffer: &[u8],
) -> (Result<Self, <C as Context>::Error>, usize)where
Self: DefaultContext<Context = C>,
C: Default,
fn read_with_length_from_buffer_copying_data(
buffer: &[u8],
) -> (Result<Self, <C as Context>::Error>, usize)where
Self: DefaultContext<Context = C>,
C: Default,
Deserializes from a given buffer while also returning the amount of bytes consumed. Read more
Source§fn read_from_stream_unbuffered(
stream: impl Read,
) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn read_from_stream_unbuffered(
stream: impl Read,
) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
Reads from a given stream without any buffering. Read more
Source§fn read_from_stream_buffered(
stream: impl Read,
) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn read_from_stream_buffered(
stream: impl Read,
) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
Reads from a given stream with internal buffering. Read more
fn read_from_file(path: impl AsRef<Path>) -> Result<Self, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn read_from_buffer_with_ctx( context: C, buffer: &'a [u8], ) -> Result<Self, <C as Context>::Error>
fn read_with_length_from_buffer_with_ctx( context: C, buffer: &'a [u8], ) -> (Result<Self, <C as Context>::Error>, usize)
fn read_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8], ) -> Result<Self, <C as Context>::Error>
fn read_with_length_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8], ) -> (Result<Self, <C as Context>::Error>, usize)
fn read_with_length_from_buffer_copying_data_with_ctx_mut( context: &mut C, buffer: &[u8], ) -> (Result<Self, <C as Context>::Error>, usize)
fn read_from_stream_unbuffered_with_ctx<S>(
context: C,
stream: S,
) -> Result<Self, <C as Context>::Error>where
S: Read,
fn read_from_stream_buffered_with_ctx<S>(
context: C,
stream: S,
) -> Result<Self, <C as Context>::Error>where
S: Read,
fn read_from_file_with_ctx( context: C, path: impl AsRef<Path>, ) -> Result<Self, <C as Context>::Error>
Source§impl Reflect for EnumValue
impl Reflect for EnumValue
fn type_descriptor(&self) -> Cow<'static, TypeDescriptor>
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn as_reflect(&self) -> &dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn patch(&mut self, value: &dyn Reflect)
fn to_value(&self) -> Value
fn clone_reflect(&self) -> Box<dyn Reflect>
fn debug(&self, f: &mut Formatter<'_>) -> Result
fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
fn type_id(&self) -> TypeId
fn type_name(&self) -> &str
fn into_tuple(self: Box<Self>) -> Option<Box<dyn Tuple>>
fn as_tuple(&self) -> Option<&dyn Tuple>
fn as_tuple_mut(&mut self) -> Option<&mut dyn Tuple>
fn into_struct(self: Box<Self>) -> Option<Box<dyn Struct>>
fn as_struct(&self) -> Option<&dyn Struct>
fn as_struct_mut(&mut self) -> Option<&mut dyn Struct>
fn into_tuple_struct(self: Box<Self>) -> Option<Box<dyn TupleStruct>>
fn as_tuple_struct(&self) -> Option<&dyn TupleStruct>
fn as_tuple_struct_mut(&mut self) -> Option<&mut dyn TupleStruct>
fn into_enum(self: Box<Self>) -> Option<Box<dyn Enum>>
fn as_enum(&self) -> Option<&dyn Enum>
fn as_enum_mut(&mut self) -> Option<&mut dyn Enum>
fn into_list(self: Box<Self>) -> Option<Box<dyn List>>
fn as_list(&self) -> Option<&dyn List>
fn as_list_mut(&mut self) -> Option<&mut dyn List>
fn into_array(self: Box<Self>) -> Option<Box<dyn Array>>
fn as_array(&self) -> Option<&dyn Array>
fn as_array_mut(&mut self) -> Option<&mut dyn Array>
fn into_map(self: Box<Self>) -> Option<Box<dyn Map>>
fn as_map(&self) -> Option<&dyn Map>
fn as_map_mut(&mut self) -> Option<&mut dyn Map>
fn into_scalar(self: Box<Self>) -> Option<ScalarOwned>
fn as_scalar(&self) -> Option<ScalarRef<'_>>
fn as_scalar_mut(&mut self) -> Option<ScalarMut<'_>>
Source§impl<C_: Context> Writable<C_> for EnumValue
impl<C_: Context> Writable<C_> for EnumValue
fn write_to<T_: ?Sized + Writer<C_>>( &self, _writer_: &mut T_, ) -> Result<(), C_::Error>
fn write_to_buffer(
&self,
buffer: &mut [u8],
) -> Result<(), <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn write_to_vec(&self) -> Result<Vec<u8>, <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn write_to_stream<S>(&self, stream: S) -> Result<(), <C as Context>::Error>
fn write_to_file(
&self,
path: impl AsRef<Path>,
) -> Result<(), <C as Context>::Error>where
Self: DefaultContext<Context = C>,
C: Default,
fn write_to_buffer_with_ctx( &self, context: C, buffer: &mut [u8], ) -> Result<(), <C as Context>::Error>
fn write_to_buffer_with_ctx_mut( &self, context: &mut C, buffer: &mut [u8], ) -> Result<(), <C as Context>::Error>
fn write_to_vec_with_ctx( &self, context: C, ) -> Result<Vec<u8>, <C as Context>::Error>
fn write_to_vec_with_ctx_mut( &self, context: &mut C, ) -> Result<Vec<u8>, <C as Context>::Error>
fn write_to_stream_with_ctx<S>(
&self,
context: C,
stream: S,
) -> Result<(), <C as Context>::Error>where
S: Write,
fn write_to_file_with_ctx( &self, context: C, path: impl AsRef<Path>, ) -> Result<(), <C as Context>::Error>
fn bytes_needed(&self) -> Result<usize, <C as Context>::Error>
impl Eq for EnumValue
impl StructuralPartialEq for EnumValue
Auto Trait Implementations§
impl Freeze for EnumValue
impl RefUnwindSafe for EnumValue
impl Send for EnumValue
impl Sync for EnumValue
impl Unpin for EnumValue
impl UnwindSafe for EnumValue
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