pub trait MapperObject {
// Required methods
fn get_type(&self) -> mpr_type;
fn set_property<T: MappableType>(&self, property: mpr_prop, value: T);
fn set_property_str(&self, property: mpr_prop, value: &str);
fn get_property<T: MappableType + Copy>(
&self,
property: mpr_prop,
) -> Result<T, PropertyError>;
fn get_property_str(
&self,
property: mpr_prop,
) -> Result<String, PropertyError>;
fn set_custom_property<T: MappableType>(
&self,
property: &str,
value: T,
publish: bool,
);
}
Required Methods§
Sourcefn set_property<T: MappableType>(&self, property: mpr_prop, value: T)
fn set_property<T: MappableType>(&self, property: mpr_prop, value: T)
Set a property on this object to a numerical value
Sourcefn set_property_str(&self, property: mpr_prop, value: &str)
fn set_property_str(&self, property: mpr_prop, value: &str)
Set a property on this object to a string value
Sourcefn get_property<T: MappableType + Copy>(
&self,
property: mpr_prop,
) -> Result<T, PropertyError>
fn get_property<T: MappableType + Copy>( &self, property: mpr_prop, ) -> Result<T, PropertyError>
Get the value of a property by it’s key from this object. If the property does not exist, or if the type is not matched, this function will return an error.
Sourcefn get_property_str(&self, property: mpr_prop) -> Result<String, PropertyError>
fn get_property_str(&self, property: mpr_prop) -> Result<String, PropertyError>
Get the value of a string property by it’s key from this object. If the property does not exist, or if the type is not matched, this function will return an error.
Sourcefn set_custom_property<T: MappableType>(
&self,
property: &str,
value: T,
publish: bool,
)
fn set_custom_property<T: MappableType>( &self, property: &str, value: T, publish: bool, )
Set a user-defined property to the specified value. The property is identified by a unique, case-sensitive string key.
If publish
is true, the property will be published to other peers. Set to false if this property is only for local use.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.