pub struct PercentProperty { /* private fields */ }Expand description
Property which clamps a double to between 0 and 1 and formats it as a percentage.
Implementations§
Source§impl PercentProperty
impl PercentProperty
Sourcepub fn new(
name: impl IntoPropertyName,
fraction: impl Into<Option<f64>>,
) -> PercentProperty
pub fn new( name: impl IntoPropertyName, fraction: impl Into<Option<f64>>, ) -> PercentProperty
Create a diagnostics property for doubles that represent percentages or fractions.
Sourcepub fn if_null(self, if_null: impl Into<String>) -> PercentProperty
pub fn if_null(self, if_null: impl Into<String>) -> PercentProperty
Dart PercentProperty(ifNull:).
Sourcepub fn with_show_name(self, show_name: bool) -> PercentProperty
pub fn with_show_name(self, show_name: bool) -> PercentProperty
Dart PercentProperty(showName:).
Sourcepub fn tooltip(self, tooltip: impl Into<String>) -> PercentProperty
pub fn tooltip(self, tooltip: impl Into<String>) -> PercentProperty
Dart PercentProperty(tooltip:).
Sourcepub fn unit(self, unit: impl Into<String>) -> PercentProperty
pub fn unit(self, unit: impl Into<String>) -> PercentProperty
Dart PercentProperty(unit:).
Sourcepub fn with_level(self, level: DiagnosticLevel) -> PercentProperty
pub fn with_level(self, level: DiagnosticLevel) -> PercentProperty
Dart PercentProperty(level:).
Sourcepub fn number_to_string(&self) -> String
pub fn number_to_string(&self) -> String
Dart’s PercentProperty.numberToString.
Sourcepub fn value_to_string(
&self,
_parent_configuration: Option<&TextTreeConfiguration>,
) -> String
pub fn value_to_string( &self, _parent_configuration: Option<&TextTreeConfiguration>, ) -> String
Dart’s PercentProperty.valueToString.
Methods from Deref<Target = DoubleProperty>§
Sourcepub fn property_data(&self) -> &PropertyData<f64>
pub fn property_data(&self) -> &PropertyData<f64>
The fields and behaviour this property shares with every DiagnosticsProperty, Dart’s
inherited members.
Sourcepub fn number_to_string(&self) -> String
pub fn number_to_string(&self) -> String
String describing just the numeric value without a unit suffix.
Sourcepub fn value_to_string(
&self,
_parent_configuration: Option<&TextTreeConfiguration>,
) -> String
pub fn value_to_string( &self, _parent_configuration: Option<&TextTreeConfiguration>, ) -> String
Dart’s _NumProperty.valueToString.
Trait Implementations§
Source§impl Deref for PercentProperty
impl Deref for PercentProperty
Source§type Target = DoubleProperty
type Target = DoubleProperty
The resulting type after dereferencing.
Source§impl DiagnosticsNode for PercentProperty
impl DiagnosticsNode for PercentProperty
Source§fn value(&self) -> Option<&(dyn Any + 'static)>
fn value(&self) -> Option<&(dyn Any + 'static)>
The actual object this diagnostics data is for. Read more
Source§fn to_json_map(
&self,
delegate: &dyn DiagnosticsSerializationDelegate,
) -> Map<String, Value>
fn to_json_map( &self, delegate: &dyn DiagnosticsSerializationDelegate, ) -> Map<String, Value>
Serializes the node to a JSON map according to the configuration provided in the
DiagnosticsSerializationDelegate: Dart’s toJsonMap. Read moreSource§fn to_description(
&self,
parent_configuration: Option<&TextTreeConfiguration>,
) -> String
fn to_description( &self, parent_configuration: Option<&TextTreeConfiguration>, ) -> String
Returns a description with a short summary of the node itself not
including children or properties.
Source§fn show_separator(&self) -> bool
fn show_separator(&self) -> bool
Whether to show a separator between
name and
to_description.Source§fn level(&self) -> DiagnosticLevel
fn level(&self) -> DiagnosticLevel
Priority level of the diagnostic.
Source§fn show_name(&self) -> bool
fn show_name(&self) -> bool
Whether the name of the property should be shown when showing the
default view of the tree.
Source§fn line_prefix(&self) -> Option<&str>
fn line_prefix(&self) -> Option<&str>
Prefix to include at the start of each line.
Source§fn style(&self) -> Option<DiagnosticsTreeStyle>
fn style(&self) -> Option<DiagnosticsTreeStyle>
Hint for how the node should be displayed.
Source§fn allow_wrap(&self) -> bool
fn allow_wrap(&self) -> bool
Whether to wrap text onto multiple lines.
Source§fn allow_name_wrap(&self) -> bool
fn allow_name_wrap(&self) -> bool
Whether to wrap the name onto multiple lines.
Source§fn to_string_deep_with(
&self,
prefix_line_one: &str,
prefix_other_lines: Option<&str>,
parent_configuration: Option<&TextTreeConfiguration>,
min_level: DiagnosticLevel,
wrap_width: usize,
) -> String
fn to_string_deep_with( &self, prefix_line_one: &str, prefix_other_lines: Option<&str>, parent_configuration: Option<&TextTreeConfiguration>, min_level: DiagnosticLevel, wrap_width: usize, ) -> String
Returns a string representation of this node and its descendants. Read more
Source§fn is_filtered(&self, min_level: DiagnosticLevel) -> bool
fn is_filtered(&self, min_level: DiagnosticLevel) -> bool
Whether the diagnostic should be filtered because its level is lower
than
min_level.Source§fn empty_body_description(&self) -> Option<&str>
fn empty_body_description(&self) -> Option<&str>
Description to show if the node has no displayed properties or children.
Source§fn value_id(&self) -> Option<HandleId>
fn value_id(&self) -> Option<HandleId>
The arena object this node describes, when it describes one. Read more
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Dart’s
Object.runtimeType.toString(): the class name, as JSON’s type prints it.Source§fn allow_truncate(&self) -> bool
fn allow_truncate(&self) -> bool
Whether to allow truncation when displaying the node and its children.
Source§fn get_properties(&self) -> Vec<Rc<dyn DiagnosticsNode>>
fn get_properties(&self) -> Vec<Rc<dyn DiagnosticsNode>>
Properties of this node.
Source§fn get_children(&self) -> Vec<Rc<dyn DiagnosticsNode>>
fn get_children(&self) -> Vec<Rc<dyn DiagnosticsNode>>
Children of this node.
Source§fn text_tree_configuration(&self) -> Option<&TextTreeConfiguration>
fn text_tree_configuration(&self) -> Option<&TextTreeConfiguration>
Configuration specifying how this node should be rendered as text art.
Source§fn to_timeline_arguments(&self) -> Option<IndexMap<String, String>>
fn to_timeline_arguments(&self) -> Option<IndexMap<String, String>>
Converts the properties of this node to a form useful for timeline
event arguments. Children are omitted.
Source§fn to_string_with(
&self,
parent_configuration: Option<&TextTreeConfiguration>,
min_level: DiagnosticLevel,
) -> String
fn to_string_with( &self, parent_configuration: Option<&TextTreeConfiguration>, min_level: DiagnosticLevel, ) -> String
Returns a string representation compatible with the style of the parent
if the node is not the root.
Source§fn to_string_deep(&self) -> String
fn to_string_deep(&self) -> String
Returns a string representation of this node and its descendants with
Dart’s default arguments.
Auto Trait Implementations§
impl !Freeze for PercentProperty
impl !RefUnwindSafe for PercentProperty
impl !Send for PercentProperty
impl !Sync for PercentProperty
impl !UnwindSafe for PercentProperty
impl Forget for PercentProperty
impl Move for PercentProperty
impl Unpin for PercentProperty
impl UnsafeUnpin for PercentPropertywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<dyn Fn() -> Option<f64>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn() -> Option<f64>>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.