[−][src]Struct rebound::info::Field
Info about a field on a Type
, either named or unnamed. Allows getting a reference to or
setting the content of this field on a Value
, assuming the reflection was configured to
allow it.
Implementations
impl Field
[src]
pub unsafe fn new_named(
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
name: &'static str,
assoc_ty: Type,
field_ty: Type
) -> Field
[src]
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
name: &'static str,
assoc_ty: Type,
field_ty: Type
) -> Field
Internal Function, creates a new named field
Safety
Should only be called within a Reflected item's fields
implementation
pub unsafe fn new_tuple(
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
idx: usize,
assoc_ty: Type,
field_ty: Type
) -> Field
[src]
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
idx: usize,
assoc_ty: Type,
field_ty: Type
) -> Field
Internal Function, creates a new unnamed field
Safety
f
Should only be called within a Reflected item's fields
implementation
pub unsafe fn new_enum_named(
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
name: &'static str,
assoc_ty: Type,
assoc_var: Variant,
field_ty: Type
) -> Field
[src]
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
name: &'static str,
assoc_ty: Type,
assoc_var: Variant,
field_ty: Type
) -> Field
Internal Function, creates a new named field for a variant
Safety
Should only be called within a Reflected item's fields
implementation
pub unsafe fn new_enum_tuple(
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
idx: usize,
assoc_ty: Type,
assoc_var: Variant,
field_ty: Type
) -> Field
[src]
get_ptr: Option<Box<dyn Fn(&'a Value<'a>) -> Value<'a>>>,
set_ptr: Option<Box<dyn Fn(&mut Value<'_>, Value<'static>)>>,
idx: usize,
assoc_ty: Type,
assoc_var: Variant,
field_ty: Type
) -> Field
Internal Function, creates a new unnamed field for a variant
Safety
Should only be called within a Reflected item's fields
implementation
pub fn assoc_ty(&self) -> Type
[src]
Get the Type this field is defined on
pub fn ty(&self) -> Type
[src]
Get the Type of the data in this field
pub fn kind(&self) -> &FieldKind
[src]
Get the kind of this field, which contains name or index information
pub fn get_ref<'a>(&self, this: &'a Value<'a>) -> Result<Value<'a>, Error>
[src]
Get a reference to the data contained within this Field on a Value
, assuming the Value
is of the correct type and the operation is supported.
pub fn set(
&self,
this: &mut Value<'_>,
other: Value<'static>
) -> Result<(), Error>
[src]
&self,
this: &mut Value<'_>,
other: Value<'static>
) -> Result<(), Error>
Set the data contained within this Field on a Value
, assuming the Values of both this
and other
are of the correct type and the operation is supported.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Field
[src]
impl !Send for Field
[src]
impl !Sync for Field
[src]
impl Unpin for Field
[src]
impl !UnwindSafe for Field
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,