#[non_exhaustive]pub struct SensorOptions<'a> { /* private fields */ }Expand description
The parameters of Metrics::sensor_with_options.
Java’s widest sensor overload
(sensor(String, MetricConfig, long, Sensor.RecordingLevel, Sensor...))
carries four parameters beyond the overload group’s {name} intersection,
so the overload naming rule makes this struct the method’s only parameter:
every Java parameter lives here, name included. This struct has no Java
counterpart: it exists solely to satisfy that naming rule.
It is #[non_exhaustive], so build it from SensorOptionsBuilder::new
and set the fields you need. Every other field’s initial value is Java’s —
what its narrower sensor overloads pass on the caller’s behalf. name has
no such initial value: Java declares no sensor overload that omits it, so
there is no Java-derived default to fall back on, and
SensorOptionsBuilder::build returns an error if it was not set. SensorOptions
itself has deliberately no Default for the same reason.
Trait Implementations§
Source§impl<'a> Clone for SensorOptions<'a>
impl<'a> Clone for SensorOptions<'a>
Source§fn clone(&self) -> SensorOptions<'a>
fn clone(&self) -> SensorOptions<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more