pub trait StructInstance<'s>: Instance<'s> {
// Required methods
fn get_value<'a>(&'a self, field: &str) -> Option<CowValue<'a, 's>>
where 's: 'a;
fn update<'a>(
&'a mut self,
update: &'a (dyn StructInstance<'s> + 's),
field_mask: Option<&FieldMask>,
replace_repeated: bool,
) -> Result<(), Error>;
fn values<'a>(&'a self) -> HashMap<SmolStr, CowValue<'a, 's>>;
fn boxed_clone(&self) -> Box<dyn StructInstance<'s> + 's>;
fn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'s> + 's>;
}Expand description
A reflected struct
Required Methods§
Sourcefn get_value<'a>(&'a self, field: &str) -> Option<CowValue<'a, 's>>where
's: 'a,
fn get_value<'a>(&'a self, field: &str) -> Option<CowValue<'a, 's>>where
's: 'a,
Returns a reference to a field in a struct
Sourcefn update<'a>(
&'a mut self,
update: &'a (dyn StructInstance<'s> + 's),
field_mask: Option<&FieldMask>,
replace_repeated: bool,
) -> Result<(), Error>
fn update<'a>( &'a mut self, update: &'a (dyn StructInstance<'s> + 's), field_mask: Option<&FieldMask>, replace_repeated: bool, ) -> Result<(), Error>
Updates an instance based on the instance passed in. If a field mask is specified only the fields passed with the mask will be updated.
Sourcefn values<'a>(&'a self) -> HashMap<SmolStr, CowValue<'a, 's>>
fn values<'a>(&'a self) -> HashMap<SmolStr, CowValue<'a, 's>>
Returns a HashMap containing all the attributes of the instance.
Sourcefn boxed_clone(&self) -> Box<dyn StructInstance<'s> + 's>
fn boxed_clone(&self) -> Box<dyn StructInstance<'s> + 's>
Returns a clone of the instance in a Box.
Sourcefn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'s> + 's>
fn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'s> + 's>
Casts Self to a Box<dyn Instance>