pub struct ScoredProperty {
pub name: Option<OwnedName>,
pub parameter_ref: Option<OwnedName>,
pub value: Option<PropertyValue>,
pub scored_properties: Vec<ScoredProperty>,
pub properties: Vec<Property>,
}Expand description
Represents a scored-property.
A ScoredProperty declares a property that is intrinsic to an Option.
Such properties should be compared when evaluating how closely a requested Option matches a device-supported Option.
Fields§
§name: Option<OwnedName>The name of the scored-property.
parameter_ref: Option<OwnedName>The parameter that this scored-property depends on.
value: Option<PropertyValue>The value of the scored-property.
scored_properties: Vec<ScoredProperty>Sub-scored-properties of the scored-property
properties: Vec<Property>Properties of the scored-property
Implementations§
Source§impl ScoredProperty
impl ScoredProperty
Sourcepub fn parameters_dependent(&self) -> Vec<OwnedName>
pub fn parameters_dependent(&self) -> Vec<OwnedName>
Collect all parameters that this scored-property depends on.
Sourcepub fn value_with<'a>(
&'a self,
parameters: &'a [ParameterInit],
) -> Option<&'a PropertyValue>
pub fn value_with<'a>( &'a self, parameters: &'a [ParameterInit], ) -> Option<&'a PropertyValue>
Get the value of this scored-property, or the value of the parameter it references.
Trait Implementations§
Source§impl Clone for ScoredProperty
impl Clone for ScoredProperty
Source§fn clone(&self) -> ScoredProperty
fn clone(&self) -> ScoredProperty
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScoredProperty
impl Debug for ScoredProperty
impl Eq for ScoredProperty
Source§impl Hash for ScoredProperty
impl Hash for ScoredProperty
Source§impl PartialEq for ScoredProperty
impl PartialEq for ScoredProperty
impl StructuralPartialEq for ScoredProperty
Source§impl WithProperties for ScoredProperty
impl WithProperties for ScoredProperty
Source§impl WithScoredProperties for ScoredProperty
impl WithScoredProperties for ScoredProperty
Source§fn scored_properties(&self) -> &[ScoredProperty]
fn scored_properties(&self) -> &[ScoredProperty]
Get the scored properties.
Source§fn get_scored_property(
&self,
name: &str,
namespace: Option<&str>,
) -> Option<&ScoredProperty>
fn get_scored_property( &self, name: &str, namespace: Option<&str>, ) -> Option<&ScoredProperty>
Get the scored-property with the given name and namespace.
Source§impl XmlSerializer for ScoredProperty
impl XmlSerializer for ScoredProperty
Auto Trait Implementations§
impl Freeze for ScoredProperty
impl RefUnwindSafe for ScoredProperty
impl Send for ScoredProperty
impl Sync for ScoredProperty
impl Unpin for ScoredProperty
impl UnsafeUnpin for ScoredProperty
impl UnwindSafe for ScoredProperty
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more