pub struct TypedPartial<'facet, T> { /* private fields */ }Expand description
A typed wrapper around Partial, for when you want to statically
ensure that build gives you the proper type.
Implementations§
Source§impl<'facet, T> TypedPartial<'facet, T>
impl<'facet, T> TypedPartial<'facet, T>
Sourcepub fn inner_mut(&mut self) -> &mut Partial<'facet>
pub fn inner_mut(&mut self) -> &mut Partial<'facet>
Unwraps the underlying Partial, consuming self.
Sourcepub fn build(&mut self) -> Result<Box<T>, ReflectError>where
T: Facet<'facet>,
pub fn build(&mut self) -> Result<Box<T>, ReflectError>where
T: Facet<'facet>,
Builds the value and returns a Box<T>
Sourcepub fn set<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn set<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Sets a value wholesale into the current frame
Sourcepub fn set_shape(
&mut self,
src_value: PtrConst<'_>,
src_shape: &'static Shape,
) -> Result<&mut Self, ReflectError>
pub fn set_shape( &mut self, src_value: PtrConst<'_>, src_shape: &'static Shape, ) -> Result<&mut Self, ReflectError>
Sets a value into the current frame by shape, for shape-based operations
Sourcepub fn begin_field(
&mut self,
field_name: &str,
) -> Result<&mut Self, ReflectError>
pub fn begin_field( &mut self, field_name: &str, ) -> Result<&mut Self, ReflectError>
Sourcepub fn begin_nth_field(&mut self, idx: usize) -> Result<&mut Self, ReflectError>
pub fn begin_nth_field(&mut self, idx: usize) -> Result<&mut Self, ReflectError>
Sourcepub fn begin_nth_element(
&mut self,
idx: usize,
) -> Result<&mut Self, ReflectError>
pub fn begin_nth_element( &mut self, idx: usize, ) -> Result<&mut Self, ReflectError>
Sourcepub fn begin_smart_ptr(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_smart_ptr(&mut self) -> Result<&mut Self, ReflectError>
Sourcepub fn end(&mut self) -> Result<&mut Self, ReflectError>
pub fn end(&mut self) -> Result<&mut Self, ReflectError>
See Partial::end
Sourcepub fn set_default(&mut self) -> Result<&mut Self, ReflectError>
pub fn set_default(&mut self) -> Result<&mut Self, ReflectError>
Sourcepub fn set_from_function<F>(&mut self, f: F) -> Result<&mut Self, ReflectError>
pub fn set_from_function<F>(&mut self, f: F) -> Result<&mut Self, ReflectError>
Sourcepub fn parse_from_str(&mut self, s: &str) -> Result<&mut Self, ReflectError>
pub fn parse_from_str(&mut self, s: &str) -> Result<&mut Self, ReflectError>
Sourcepub fn select_variant(
&mut self,
discriminant: i64,
) -> Result<&mut Self, ReflectError>
pub fn select_variant( &mut self, discriminant: i64, ) -> Result<&mut Self, ReflectError>
Sourcepub fn select_variant_named(
&mut self,
variant_name: &str,
) -> Result<&mut Self, ReflectError>
pub fn select_variant_named( &mut self, variant_name: &str, ) -> Result<&mut Self, ReflectError>
Sourcepub fn select_nth_variant(
&mut self,
index: usize,
) -> Result<&mut Self, ReflectError>
pub fn select_nth_variant( &mut self, index: usize, ) -> Result<&mut Self, ReflectError>
See Partial::select_nth_variant to the inner partial instance.
Sourcepub fn begin_nth_enum_field(
&mut self,
idx: usize,
) -> Result<&mut Self, ReflectError>
pub fn begin_nth_enum_field( &mut self, idx: usize, ) -> Result<&mut Self, ReflectError>
See Partial::begin_nth_enum_field to the inner partial instance.
Sourcepub fn begin_list(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_list(&mut self) -> Result<&mut Self, ReflectError>
Sourcepub fn begin_list_item(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_list_item(&mut self) -> Result<&mut Self, ReflectError>
Sourcepub fn begin_map(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_map(&mut self) -> Result<&mut Self, ReflectError>
Sourcepub fn begin_key(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_key(&mut self) -> Result<&mut Self, ReflectError>
Sourcepub fn begin_value(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_value(&mut self) -> Result<&mut Self, ReflectError>
Sourcepub fn path(&self) -> String
pub fn path(&self) -> String
Returns a human-readable path representing the current traversal in the builder,
e.g., RootStruct.fieldName[index].subfield.
Sourcepub fn set_nth_element<U>(
&mut self,
idx: usize,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn set_nth_element<U>(
&mut self,
idx: usize,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Convenience shortcut: sets the nth element of an array directly to value, popping after.
Sourcepub fn set_nth_field<U>(
&mut self,
idx: usize,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn set_nth_field<U>(
&mut self,
idx: usize,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Convenience shortcut: sets the field at index idx directly to value, popping after.
Sourcepub fn set_field<U>(
&mut self,
field_name: &str,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn set_field<U>(
&mut self,
field_name: &str,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Convenience shortcut: sets the named field to value, popping after.
Sourcepub fn set_nth_enum_field<U>(
&mut self,
idx: usize,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn set_nth_enum_field<U>(
&mut self,
idx: usize,
value: U,
) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Convenience shortcut: sets the nth field of an enum variant directly to value, popping after.
Sourcepub fn set_key<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn set_key<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Convenience shortcut: sets the key for a map key-value insertion, then pops after.
Sourcepub fn set_value<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn set_value<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Convenience shortcut: sets the value for a map key-value insertion, then pops after.
Sourcepub fn push<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
pub fn push<U>(&mut self, value: U) -> Result<&mut Self, ReflectError>where
U: Facet<'facet>,
Shorthand for: begin_list_item(), set(), end(), useful when pushing a scalar
Sourcepub fn begin_some(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_some(&mut self) -> Result<&mut Self, ReflectError>
Begin building the Some variant of an Option
Sourcepub fn begin_inner(&mut self) -> Result<&mut Self, ReflectError>
pub fn begin_inner(&mut self) -> Result<&mut Self, ReflectError>
Begin building the inner value of a wrapper type