Trait tap::reflect::ReflectStruct
source · [−]pub trait ReflectStruct: Sync + Send + Debug {
fn name(&self) -> &'static str;
fn infos(&self) -> Vec<(&'static str, Option<&'static str>)>;
fn get_value(&self, name: &str) -> Option<Value>;
fn names(&self) -> Vec<&'static str> { ... }
fn descriptions(&self) -> Vec<Option<&'static str>> { ... }
fn attributes(&self) -> Vec<Attribute> { ... }
fn count(&self) -> usize { ... }
}
Expand description
ReflectStruct is a trait used to wrapper a struct and give dynamic reflection information and access to the value of their a members.
Required methods
Return the name of the ReflectStruct.
Return a tuple containing the name and description of each field of the ReflectStruct.
Provided methods
fn descriptions(&self) -> Vec<Option<&'static str>>
fn descriptions(&self) -> Vec<Option<&'static str>>
Return description of all the member field of the struct.
fn attributes(&self) -> Vec<Attribute>
fn attributes(&self) -> Vec<Attribute>
Return a Vector of Attribute containing a tuple name, value, description of the all the field of the struct. If ReflectStruct bind function, the function will be called to get the resulting Value.