pub struct LuaFieldDescriptor(pub FieldDescriptor);
Tuple Fields§
§0: FieldDescriptor
Methods from Deref<Target = FieldDescriptor>§
Sourcepub fn proto(&self) -> &FieldDescriptorProto
pub fn proto(&self) -> &FieldDescriptorProto
Get .proto
description of field
Sourcepub fn full_name(&self) -> String
pub fn full_name(&self) -> String
Fully qualified name of the field: fully qualified name of the declaring type followed by the field name.
Declaring type is a message (for regular field or extensions) or a package (for top-level extensions).
Sourcepub fn containing_oneof_including_synthetic(&self) -> Option<OneofDescriptor>
pub fn containing_oneof_including_synthetic(&self) -> Option<OneofDescriptor>
Oneof descriptor containing this field. Do not skip synthetic oneofs.
Sourcepub fn containing_oneof(&self) -> Option<OneofDescriptor>
pub fn containing_oneof(&self) -> Option<OneofDescriptor>
Oneof containing this field.
Return None
if this field is not part of oneof or if it is synthetic oneof.
Sourcepub fn containing_message(&self) -> MessageDescriptor
pub fn containing_message(&self) -> MessageDescriptor
Message which contains this field.
For extension fields, this is the message being extended.
Sourcepub fn is_singular(&self) -> bool
pub fn is_singular(&self) -> bool
If this field is optional or required.
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Is this field required.
Sourcepub fn is_repeated_or_map(&self) -> bool
pub fn is_repeated_or_map(&self) -> bool
If this field repeated or map?
Sourcepub fn is_repeated(&self) -> bool
pub fn is_repeated(&self) -> bool
Is this field repeated, but not map field?
Sourcepub fn has_field(&self, m: &(dyn MessageDyn + 'static)) -> bool
pub fn has_field(&self, m: &(dyn MessageDyn + 'static)) -> bool
Check if field is set in given message.
For repeated field or map field return true
if
collection is not empty.
§Panics
If this field belongs to a different message type.
Sourcepub fn get_message<'a>(
&self,
m: &'a (dyn MessageDyn + 'static),
) -> MessageRef<'a>
pub fn get_message<'a>( &self, m: &'a (dyn MessageDyn + 'static), ) -> MessageRef<'a>
Get message field or default instance if field is unset.
§Panics
If this field belongs to a different message type or field type is not message.
Sourcepub fn mut_message<'a>(
&self,
m: &'a mut (dyn MessageDyn + 'static),
) -> &'a mut (dyn MessageDyn + 'static)
pub fn mut_message<'a>( &self, m: &'a mut (dyn MessageDyn + 'static), ) -> &'a mut (dyn MessageDyn + 'static)
Get a mutable reference to a message field. Initialize field with default message if unset.
§Panics
If this field belongs to a different message type or field type is not singular message.
Sourcepub fn singular_default_value(&self) -> ReflectValueRef<'_>
pub fn singular_default_value(&self) -> ReflectValueRef<'_>
Sourcepub fn get_singular_field_or_default<'a>(
&self,
m: &'a (dyn MessageDyn + 'static),
) -> ReflectValueRef<'a>
pub fn get_singular_field_or_default<'a>( &self, m: &'a (dyn MessageDyn + 'static), ) -> ReflectValueRef<'a>
Get singular field value.
Return field default value if field is unset.
§Panics
If this field belongs to a different message type or fields is not singular.
Sourcepub fn singular_runtime_type(&self) -> RuntimeType
pub fn singular_runtime_type(&self) -> RuntimeType
Runtime representation of singular field.
§Panics
If this field belongs to a different message type or field is not singular.
Sourcepub fn set_singular_field(
&self,
m: &mut (dyn MessageDyn + 'static),
value: ReflectValueBox,
)
pub fn set_singular_field( &self, m: &mut (dyn MessageDyn + 'static), value: ReflectValueBox, )
Set singular field.
§Panics
If this field belongs to a different message type or field is not singular or value is of different type.
Sourcepub fn clear_field(&self, m: &mut (dyn MessageDyn + 'static))
pub fn clear_field(&self, m: &mut (dyn MessageDyn + 'static))
Clear a field.
Sourcepub fn runtime_field_type(&self) -> RuntimeFieldType
pub fn runtime_field_type(&self) -> RuntimeFieldType
Dynamic representation of field type.
Sourcepub fn get_reflect<'a>(
&self,
m: &'a (dyn MessageDyn + 'static),
) -> ReflectFieldRef<'a>
pub fn get_reflect<'a>( &self, m: &'a (dyn MessageDyn + 'static), ) -> ReflectFieldRef<'a>
Sourcepub fn get_singular<'a>(
&self,
m: &'a (dyn MessageDyn + 'static),
) -> Option<ReflectValueRef<'a>>
pub fn get_singular<'a>( &self, m: &'a (dyn MessageDyn + 'static), ) -> Option<ReflectValueRef<'a>>
Get singular field value.
Return None
if field is unset.
§Panics
If this field belongs to a different message type or fields is not singular.
Sourcepub fn get_repeated<'a>(
&self,
m: &'a (dyn MessageDyn + 'static),
) -> ReflectRepeatedRef<'a>
pub fn get_repeated<'a>( &self, m: &'a (dyn MessageDyn + 'static), ) -> ReflectRepeatedRef<'a>
Get repeated field.
§Panics
If this field belongs to a different message type or field is not repeated.
Sourcepub fn mut_repeated<'a>(
&self,
m: &'a mut (dyn MessageDyn + 'static),
) -> ReflectRepeatedMut<'a>
pub fn mut_repeated<'a>( &self, m: &'a mut (dyn MessageDyn + 'static), ) -> ReflectRepeatedMut<'a>
Get a mutable reference to repeated
field.
§Panics
If this field belongs to a different message type or field is not repeated
.
Sourcepub fn get_map<'a>(
&self,
m: &'a (dyn MessageDyn + 'static),
) -> ReflectMapRef<'a>
pub fn get_map<'a>( &self, m: &'a (dyn MessageDyn + 'static), ) -> ReflectMapRef<'a>
Sourcepub fn mut_map<'a>(
&self,
m: &'a mut (dyn MessageDyn + 'static),
) -> ReflectMapMut<'a>
pub fn mut_map<'a>( &self, m: &'a mut (dyn MessageDyn + 'static), ) -> ReflectMapMut<'a>
Get a mutable reference to map
field.
§Panics
If this field belongs to a different message type or field is not map
.
Trait Implementations§
Source§impl Clone for LuaFieldDescriptor
impl Clone for LuaFieldDescriptor
Source§fn clone(&self) -> LuaFieldDescriptor
fn clone(&self) -> LuaFieldDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Deref for LuaFieldDescriptor
impl Deref for LuaFieldDescriptor
Source§impl From<FieldDescriptor> for LuaFieldDescriptor
impl From<FieldDescriptor> for LuaFieldDescriptor
Source§fn from(value: FieldDescriptor) -> Self
fn from(value: FieldDescriptor) -> Self
Source§impl From<LuaFieldDescriptor> for FieldDescriptor
impl From<LuaFieldDescriptor> for FieldDescriptor
Source§fn from(value: LuaFieldDescriptor) -> Self
fn from(value: LuaFieldDescriptor) -> Self
Source§impl PartialEq for LuaFieldDescriptor
impl PartialEq for LuaFieldDescriptor
Source§impl UserData for LuaFieldDescriptor
impl UserData for LuaFieldDescriptor
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Source§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Source§fn register(registry: &mut UserDataRegistry<Self>)
fn register(registry: &mut UserDataRegistry<Self>)
impl Eq for LuaFieldDescriptor
impl StructuralPartialEq for LuaFieldDescriptor
Auto Trait Implementations§
impl Freeze for LuaFieldDescriptor
impl !RefUnwindSafe for LuaFieldDescriptor
impl Send for LuaFieldDescriptor
impl Sync for LuaFieldDescriptor
impl Unpin for LuaFieldDescriptor
impl !UnwindSafe for LuaFieldDescriptor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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