Struct arpx::LogMonitor
source · [−]pub struct LogMonitor {
pub buffer: RollingBuffer,
pub buffer_size: usize,
pub ctx: Ctx,
pub name: String,
pub ontrigger: String,
pub test: String,
}
Expand description
Represents and contains a given runtime job task log monitor.
This object contains all of the data necessary to run a given log monitor. This data includes
the log monitor name, the size of its rolling buffer, the rolling buffer instance itself, the
test
command which should be executed on each push to the buffer, and the ontrigger
action
which should run if test
returns with a 0
exit code.
Fields
buffer: RollingBuffer
buffer_size: usize
ctx: Ctx
name: String
ontrigger: String
test: String
Implementations
sourceimpl LogMonitor
impl LogMonitor
sourcepub fn buffer_size(self, b: usize) -> Self
pub fn buffer_size(self, b: usize) -> Self
Builds LogMonitor
with the specified rolling buffer size.
sourcepub fn ontrigger(self, o: String) -> Self
pub fn ontrigger(self, o: String) -> Self
Builds LogMonitor
with the name of the action to execute if the test
succeeds.
sourcepub fn run(
self,
ontrigger: Option<Box<dyn Fn() + Send>>
) -> Result<(JoinHandle<()>, Sender<LogMonitorMessage>)>
pub fn run(
self,
ontrigger: Option<Box<dyn Fn() + Send>>
) -> Result<(JoinHandle<()>, Sender<LogMonitorMessage>)>
Executes the log monitor using the provided action.
Trait Implementations
sourceimpl Clone for LogMonitor
impl Clone for LogMonitor
sourcefn clone(&self) -> LogMonitor
fn clone(&self) -> LogMonitor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for LogMonitor
impl Send for LogMonitor
impl Sync for LogMonitor
impl Unpin for LogMonitor
impl UnwindSafe for LogMonitor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CloneAny for T where
T: Any + Clone,
impl<T> CloneAny for T where
T: Any + Clone,
fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>
fn clone_any_send(&self) -> Box<dyn CloneAny + Send + 'static, Global> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync + 'static, Global> where
T: Sync,
fn clone_any_send_sync(
&self
) -> Box<dyn CloneAny + Send + Sync + 'static, Global> where
T: Send + Sync,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more