pub struct Ping { /* private fields */ }
Expand description
Displays the ping to a given address
Requires the cap_net_raw
capability. See
https://man7.org/linux/man-pages/man7/capabilities.7.html for more
details.
Trait Implementations§
Source§impl PanelConfig for Ping
impl PanelConfig for Ping
Source§fn parse(
name: &'static str,
table: &mut HashMap<String, Value>,
_global: &Config,
) -> Result<Self>
fn parse( name: &'static str, table: &mut HashMap<String, Value>, _global: &Config, ) -> Result<Self>
Configuration options:
address
: the IP address to ping- type: String
- default: 8.8.8.8
interval
: how long in seconds to wait between runs- type: u64
- default: 60
pings
: how many times to ping per run (the results will be averaged)- type: u64
- default 5
format_connected
: the format string- type: String
- formatting options:
%ping%
,%ramp%
- default:
%ping%ms
format_disconnected
: the format string when all pings fail- type: String
- default:
disconnected
ramp
: the ramp to display based on the ping time. SeeRamp::parse
for parsing details.max_ping
: the value to use as the maximum for the ramp. Ignored iframp
is unset. Clamped to [0, 2000].- type: u64
- default: 2000
attrs
: A string specifying the attrs for the panel. SeeAttrs::parse
for details.highlight
: A string specifying the highlight for the panel. SeeHighlight::parse
for details.ramp
: A string specifying the ramp to show ping. SeeRamp::parse
for details.- See
PanelCommon::parse_common
.
Source§fn props(&self) -> (&'static str, bool)
fn props(&self) -> (&'static str, bool)
Returns the name of the panel. If the panel supports events, each
instance must return a unique name.
Source§fn run<'async_trait>(
self: Box<Self>,
cr: Rc<Context>,
global_attrs: Attrs,
height: i32,
) -> Pin<Box<dyn Future<Output = PanelRunResult> + 'async_trait>>where
Self: 'async_trait,
fn run<'async_trait>(
self: Box<Self>,
cr: Rc<Context>,
global_attrs: Attrs,
height: i32,
) -> Pin<Box<dyn Future<Output = PanelRunResult> + 'async_trait>>where
Self: 'async_trait,
Performs any necessary setup, then returns a
PanelStream
representing the provided PanelConfig
. Read moreAuto Trait Implementations§
impl Freeze for Ping
impl !RefUnwindSafe for Ping
impl !Send for Ping
impl !Sync for Ping
impl Unpin for Ping
impl !UnwindSafe for Ping
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