pub enum ProbeResult {
Success,
Defer(String),
Failed(ModuleError),
}Expand description
Result of module probe/initialization.
Linux equivalent: Return value from probe() function.
Success= success (Linux:0)Defer= try again later (Linux:-EPROBE_DEFER)Failed= permanent failure (Linux: negative errno)
§Example
ⓘ
fn init(&mut self, ctx: &ModuleContext) -> ProbeResult {
if !ctx.kernel.event_bus.has_subscriber("treesitter") {
return ProbeResult::Defer("waiting for treesitter".into());
}
ProbeResult::Success
}Variants§
Success
Probe succeeded, module is ready.
Defer(String)
Probe deferred, retry later (with reason).
Linux equivalent: -EPROBE_DEFER
Failed(ModuleError)
Probe failed permanently.
Trait Implementations§
Source§impl Clone for ProbeResult
impl Clone for ProbeResult
Source§fn clone(&self) -> ProbeResult
fn clone(&self) -> ProbeResult
Returns a duplicate of the value. Read more
1.0.0 · 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 ProbeResult
impl Debug for ProbeResult
Source§impl PartialEq for ProbeResult
impl PartialEq for ProbeResult
impl Eq for ProbeResult
impl StructuralPartialEq for ProbeResult
Auto Trait Implementations§
impl Freeze for ProbeResult
impl RefUnwindSafe for ProbeResult
impl Send for ProbeResult
impl Sync for ProbeResult
impl Unpin for ProbeResult
impl UnsafeUnpin for ProbeResult
impl UnwindSafe for ProbeResult
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