pub struct NoopTool;Expand description
The concrete empty subtool supported by this first typed snapshot domain. A tool that only injects the syscall it receives.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NoopTool
impl<'de> Deserialize<'de> for NoopTool
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Tool for NoopTool
impl Tool for NoopTool
Source§type GlobalState = GlobalState
type GlobalState = GlobalState
Source§type ThreadState = ()
type ThreadState = ()
(), indicating that the tool does not have thread-level
state. Read moreSource§fn stream_role() -> ToolStreamRole
fn stream_role() -> ToolStreamRole
Source§fn native_mm_ownership(_cfg: &Config) -> NativeMmOwnership
fn native_mm_ownership(_cfg: &Config) -> NativeMmOwnership
NativeMmOwnership] for the complete obligation. Read moreSource§fn subscriptions(_cfg: &Config) -> Subscription
fn subscriptions(_cfg: &Config) -> Subscription
Source§fn handle_syscall_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
guest: &'life1 mut T,
call: Syscall,
) -> Pin<Box<dyn Future<Output = Result<i64, Error>> + Send + 'async_trait>>where
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_syscall_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
guest: &'life1 mut T,
call: Syscall,
) -> Pin<Box<dyn Future<Output = Result<i64, Error>> + Send + 'async_trait>>where
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
§fn new(_pid: Pid, _cfg: &<Self::GlobalState as GlobalTool>::Config) -> Self
fn new(_pid: Pid, _cfg: &<Self::GlobalState as GlobalTool>::Config) -> Self
§fn observes_native_syscalls(
_cfg: &<Self::GlobalState as GlobalTool>::Config,
) -> bool
fn observes_native_syscalls( _cfg: &<Self::GlobalState as GlobalTool>::Config, ) -> bool
§fn observe_native_syscall(
&self,
_state: &Self::ThreadState,
_facts: &dyn NativeSyscallFacts,
_call: &NativeSyscallCall,
) -> Result<Option<Arc<dyn NativeSyscallObserver>>, Error>
fn observe_native_syscall( &self, _state: &Self::ThreadState, _facts: &dyn NativeSyscallFacts, _call: &NativeSyscallCall, ) -> Result<Option<Arc<dyn NativeSyscallObserver>>, Error>
§fn facility_admission(
_cfg: &<Self::GlobalState as GlobalTool>::Config,
) -> Result<(), Error>
fn facility_admission( _cfg: &<Self::GlobalState as GlobalTool>::Config, ) -> Result<(), Error>
§fn reserved_input_requirement(
_cfg: &<Self::GlobalState as GlobalTool>::Config,
) -> Option<ReservedInputRequirement>
fn reserved_input_requirement( _cfg: &<Self::GlobalState as GlobalTool>::Config, ) -> Option<ReservedInputRequirement>
§fn thread_ownership(
_cfg: &<Self::GlobalState as GlobalTool>::Config,
) -> ThreadOwnership
fn thread_ownership( _cfg: &<Self::GlobalState as GlobalTool>::Config, ) -> ThreadOwnership
CLONE_THREAD) are
owned. See [ThreadOwnership]. Called once per tree, like
[Tool::subscriptions]. Read more§fn init_thread_state(
&self,
_child: Pid,
_parent: Option<(Pid, &Self::ThreadState)>,
) -> Self::ThreadState
fn init_thread_state( &self, _child: Pid, _parent: Option<(Pid, &Self::ThreadState)>, ) -> Self::ThreadState
§fn on_initial_image_attached(
&self,
_tid: Pid,
_thread_state: &mut Self::ThreadState,
) -> Result<(), Error>
fn on_initial_image_attached( &self, _tid: Pid, _thread_state: &mut Self::ThreadState, ) -> Result<(), Error>
§fn handle_thread_start<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_thread_start<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
handle_syscall_event, except this traps the first
instruction executed by a new thread. Typical uses of this method include
delaying thread execution or running initialization actions (injections
or rpcs). Read more§fn on_thread_state_ready(
&self,
_tid: Pid,
_global_state: &Self::GlobalState,
_thread_state: &Self::ThreadState,
) -> Result<(), Error>
fn on_thread_state_ready( &self, _tid: Pid, _global_state: &Self::GlobalState, _thread_state: &Self::ThreadState, ) -> Result<(), Error>
handle_thread_start or handle_post_exec, before ordinary guest
execution resumes. The ptrace backend supplies this synchronous hook;
other backends must implement an equivalent owned lifecycle boundary
before relying on it. The default performs no work. Read more§fn handle_post_exec<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_post_exec<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
handle_syscall_event, after
injecting execve, it is not possible to run code after a successful
execve because it never returns. Read more§fn handle_exec_commit<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_exec_commit<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
execve or execveat this Tool injected can no longer
fail, on a backend that carries the exec out itself rather than through
a host kernel exec (today the KVM backend). The backend has finished
every step that could fail: it has read the path, the argument strings
and the environment strings out of guest memory and validated the new
image. The old image’s memory is still this guest’s, and the image is
replaced only after this returns; handle_post_exec then follows in
the new image, and the injection does not return. This is the point
Linux’s begin_new_exec reaches past point_of_no_return, where
exec_mmap runs exec_mm_release on the old address space
(fs/exec.c), after do_execveat_common has copied the strings. A
Tool that models what Linux does to the old image there, such as the
robust-futex walk futex_exec_release makes, does it here, where the
strings the new image receives can no longer change. Read more§fn handle_cpuid_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
eax: u32,
ecx: u32,
) -> Pin<Box<dyn Future<Output = Result<CpuIdResult, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_cpuid_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
eax: u32,
ecx: u32,
) -> Pin<Box<dyn Future<Output = Result<CpuIdResult, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
[eax, ebx, ecx, edx]. Read more§fn handle_rdtsc_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
request: Rdtsc,
) -> Pin<Box<dyn Future<Output = Result<RdtscResult, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_rdtsc_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
request: Rdtsc,
) -> Pin<Box<dyn Future<Output = Result<RdtscResult, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
§fn handle_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
signal: Signal,
) -> Pin<Box<dyn Future<Output = Result<Option<Signal>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
signal: Signal,
) -> Pin<Box<dyn Future<Output = Result<Option<Signal>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
§fn handle_raw_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
signal: i32,
) -> Pin<Box<dyn Future<Output = Result<Option<i32>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_raw_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
signal: i32,
) -> Pin<Box<dyn Future<Output = Result<Option<i32>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
Signal] cannot name before it is
delivered to the guest: a realtime signal, numbered 32 to 64 (glibc
reserves 32 and 33, so SIGRTMIN() is 34). signal is the raw number.
A backend reports every other signal to [Tool::handle_signal_event]
(https://github.com/rrnewton/reverie/issues/207). Read more§fn announce_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
signal: i32,
) -> Pin<Box<dyn Future<Output = Result<Option<SignalAnnouncement>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn announce_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
signal: i32,
) -> Pin<Box<dyn Future<Output = Result<Option<SignalAnnouncement>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
signal is the raw number, 1 to 64;
any other is EINVAL. Read more§fn commit_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
_announcement: SignalAnnouncement,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn commit_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
_announcement: SignalAnnouncement,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
Tool::announce_signal_event]): the backend’s final read confirmed
that the kernel delivers the announced signal when the runtime returns
to guest code, and the Tool records the delivery. It must not wait for
a turn in its schedule, and cannot suppress or replace the signal; an
Err ends the run. The default refuses with EOPNOTSUPP.§fn withdraw_signal_event(
&self,
_thread_state: &mut Self::ThreadState,
_announcement: SignalAnnouncement,
)
fn withdraw_signal_event( &self, _thread_state: &mut Self::ThreadState, _announcement: SignalAnnouncement, )
Tool::announce_signal_event]) whose
delivery does not happen at the runtime’s return: another signal
pushed it out. The signal stays pending in the kernel, to be announced
again at a later return. It can only record: it gets the thread’s
state and no access to the guest. The default records nothing.§fn exit_for_predicted_death<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
_status: ExitStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn exit_for_predicted_death<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
_status: ExitStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
Tool::announce_signal_event], step 3): the last committed delivery
is default-fatal, and status names the signal it dies of
([crate::PredictionEnd::Death]). status is not a wait status and
must not be forwarded as one: its core flag is always false, because
whether a core is written is known only when the kernel has tried
(whether the default action asks for one is
[crate::PredictedAction::Fatal]’s core_dump); the wait status a
parent sees comes from the kernel at the reap. The backend has already
withdrawn every announcement behind that delivery. Read more§fn filter_unreported_signal<'life0, 'life1, 'async_trait, R>(
&'life0 self,
_rpc: &'life1 R,
_signal: UnreportedSignal,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
R: 'async_trait + GlobalRPC<Self::GlobalState>,
Self: 'async_trait,
fn filter_unreported_signal<'life0, 'life1, 'async_trait, R>(
&'life0 self,
_rpc: &'life1 R,
_signal: UnreportedSignal,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
R: 'async_trait + GlobalRPC<Self::GlobalState>,
Self: 'async_trait,
Tool::handle_signal_event] reaches the guest at all. Read more§fn observes_sigreturns(
_config: &<Self::GlobalState as GlobalTool>::Config,
) -> bool
fn observes_sigreturns( _config: &<Self::GlobalState as GlobalTool>::Config, ) -> bool
rt_sigreturn reported to
[Tool::handle_sigreturn], known from configuration alone. A backend
whose capabilities say it reports sigreturns
(BackendCapabilities::reports_sigreturns)
then reports each one, except those the capability names; the ptrace
backend stops at each guest rt_sigreturn only for such a Tool, and
not while its gdbserver is attached. The default wants none, so a
backend adds no stop.§fn in_guest_signal_delivery(
_config: &<Self::GlobalState as GlobalTool>::Config,
) -> bool
fn in_guest_signal_delivery( _config: &<Self::GlobalState as GlobalTool>::Config, ) -> bool
crate::predict_deliveries]), reports them in two phases
([Tool::announce_signal_event]), and makes a predicted death a
scheduled one ([Tool::exit_for_predicted_death]). Such a backend
reads it once, when its runtime starts in a process, and keeps its
existing delivery when it does not hold. Read more§fn enforces_serialized_execution(
_config: &<Self::GlobalState as GlobalTool>::Config,
) -> bool
fn enforces_serialized_execution( _config: &<Self::GlobalState as GlobalTool>::Config, ) -> bool
§fn handle_sigreturn(
&self,
_thread_state: &mut Self::ThreadState,
_report: SigreturnReport,
)
fn handle_sigreturn( &self, _thread_state: &mut Self::ThreadState, _report: SigreturnReport, )
rt_sigreturn before it runs, for a Tool for which
[Tool::observes_sigreturns] holds, on a backend that reports
sigreturns. The backend then carries the call out exactly as it would
without the hook. Read more§fn note_unreported_signal(
&self,
_thread_state: &mut Self::ThreadState,
_signal: &UnreportedSignal,
_kept: bool,
)
fn note_unreported_signal( &self, _thread_state: &mut Self::ThreadState, _signal: &UnreportedSignal, _kept: bool, )
Tool::filter_unreported_signal] decided about
it: kept is that hook’s answer. A kept signal is resumed into the
guest, and Linux then delivers it, puts it back in the queue when the
thread’s mask blocks it (a later stop can take the same instance again
and pass it once more), queues a new instance with a kernel siginfo
(a syscall stop), or discards it (an ignored signal, or a ptrace event
stop or group stop); a dropped one is not resumed. So the hook sees
passes, not deliveries. The signal’s
[crate::UnreportedSignal::reason] says why it was not reported, so
that a Tool can count what its signal callback never saw. Read more§fn may_observe_signal_dequeues(
_config: &<Self::GlobalState as GlobalTool>::Config,
) -> bool
fn may_observe_signal_dequeues( _config: &<Self::GlobalState as GlobalTool>::Config, ) -> bool
§fn requires_signal_control(
_config: &<Self::GlobalState as GlobalTool>::Config,
) -> bool
fn requires_signal_control( _config: &<Self::GlobalState as GlobalTool>::Config, ) -> bool
§fn handle_signal_dequeue<'life0, 'life1, 'async_trait, G>(
&'life0 self,
_guest: &'life1 mut G,
_dequeue: SignalDequeue,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
G: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_signal_dequeue<'life0, 'life1, 'async_trait, G>(
&'life0 self,
_guest: &'life1 mut G,
_dequeue: SignalDequeue,
) -> Pin<Box<dyn Future<Output = Result<(), Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
G: 'async_trait + Guest<Self>,
Self: 'async_trait,
§fn handle_structured_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
guest: &'life1 mut T,
event: SignalEvent,
) -> Pin<Box<dyn Future<Output = Result<Option<SignalEvent>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_structured_signal_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
guest: &'life1 mut T,
event: SignalEvent,
) -> Pin<Box<dyn Future<Output = Result<Option<SignalEvent>, Errno>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
§fn handle_timer_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
fn handle_timer_event<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_guest: &'life1 mut T,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait + Guest<Self>,
Self: 'async_trait,
Guest::set_timer§fn on_exit_thread<'life0, 'life1, 'async_trait, G>(
&'life0 self,
_tid: Pid,
_global_state: &'life1 G,
_thread_state: Self::ThreadState,
_exit_status: ExitStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
G: 'async_trait + GlobalRPC<Self::GlobalState>,
Self: 'async_trait,
fn on_exit_thread<'life0, 'life1, 'async_trait, G>(
&'life0 self,
_tid: Pid,
_global_state: &'life1 G,
_thread_state: Self::ThreadState,
_exit_status: ExitStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
G: 'async_trait + GlobalRPC<Self::GlobalState>,
Self: 'async_trait,
§fn on_exit_process<'life0, 'async_trait, G>(
self,
_pid: Pid,
_global_state: &'life0 G,
_exit_status: ExitStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
G: 'async_trait + GlobalRPC<Self::GlobalState>,
Self: 'async_trait,
fn on_exit_process<'life0, 'async_trait, G>(
self,
_pid: Pid,
_global_state: &'life0 G,
_exit_status: ExitStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
G: 'async_trait + GlobalRPC<Self::GlobalState>,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for NoopTool
impl RefUnwindSafe for NoopTool
impl Send for NoopTool
impl Sync for NoopTool
impl Unpin for NoopTool
impl UnsafeUnpin for NoopTool
impl UnwindSafe for NoopTool
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
§impl<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> RecordOrReplay for Twhere
T: Tool<GlobalState = GlobalState>,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.