Struct otter_nodejs_tests::otter_support::crates::flexi_logger::Logger
[−]pub struct Logger { /* private fields */ }
Expand description
The entry-point for using flexi_logger
.
Logger
is a builder class that allows you to
-
specify your desired (initial) loglevel-specification
- either as a String (
Logger::try_with_str
) - or by providing it in the environment (
Logger::try_with_env
), - or by combining both options (
Logger::try_with_env_or_str
), - or by building a
LogSpecification
programmatically (Logger::with
),
- either as a String (
-
use the desired configuration methods,
-
and finally start the logger with
Usage
See code_examples
for a comprehensive list of usage possibilities.
Implementations
impl Logger
impl Logger
Create a Logger instance and define how to access the (initial) loglevel-specification.
pub fn with(logspec: LogSpecification) -> Logger
pub fn with(logspec: LogSpecification) -> Logger
Creates a Logger that you provide with an explicit LogSpecification
.
pub fn try_with_str<S>(s: S) -> Result<Logger, FlexiLoggerError> where
S: AsRef<str>,
pub fn try_with_str<S>(s: S) -> Result<Logger, FlexiLoggerError> where
S: AsRef<str>,
Creates a Logger that reads the LogSpecification
from a String
or &str
.
See LogSpecification
for the syntax.
Errors
FlexiLoggerError::Parse
if the String uses an erroneous syntax.
pub fn try_with_env() -> Result<Logger, FlexiLoggerError>
pub fn try_with_env() -> Result<Logger, FlexiLoggerError>
Creates a Logger that reads the LogSpecification
from the environment variable
RUST_LOG
.
Note that if RUST_LOG
is not set, nothing is logged.
Errors
FlexiLoggerError::Parse
if the value of RUST_LOG
is malformed.
pub fn try_with_env_or_str<S>(s: S) -> Result<Logger, FlexiLoggerError> where
S: AsRef<str>,
pub fn try_with_env_or_str<S>(s: S) -> Result<Logger, FlexiLoggerError> where
S: AsRef<str>,
Creates a Logger that reads the LogSpecification
from the environment variable
RUST_LOG
, or derives it from the given String
, if RUST_LOG
is not set.
Errors
FlexiLoggerError::Parse
if the chosen value is malformed.
impl Logger
impl Logger
Simple methods for influencing the behavior of the Logger.
pub fn log_to_stderr(self) -> Logger
pub fn log_to_stderr(self) -> Logger
Log is written to stderr (which is the default).
pub fn log_to_stdout(self) -> Logger
pub fn log_to_stdout(self) -> Logger
Log is written to stdout.
pub fn log_to_file(self, file_spec: FileSpec) -> Logger
pub fn log_to_file(self, file_spec: FileSpec) -> Logger
Log is written to a file.
The default filename pattern is <program_name>_<date>_<time>.<suffix>
,
e.g. myprog_2015-07-08_10-44-11.log
.
You can duplicate to stdout and stderr, and you can add additional writers.
pub fn log_to_writer(self, w: Box<dyn LogWriter + 'static, Global>) -> Logger
pub fn log_to_writer(self, w: Box<dyn LogWriter + 'static, Global>) -> Logger
Log is written to the provided writer.
You can duplicate to stdout and stderr, and you can add additional writers.
pub fn log_to_file_and_writer(
self,
file_spec: FileSpec,
w: Box<dyn LogWriter + 'static, Global>
) -> Logger
pub fn log_to_file_and_writer(
self,
file_spec: FileSpec,
w: Box<dyn LogWriter + 'static, Global>
) -> Logger
Log is written to a file, as with Logger::log_to_file
, and to an alternative
LogWriter
implementation.
And you can duplicate to stdout and stderr, and you can add additional writers.
pub fn do_not_log(self) -> Logger
pub fn do_not_log(self) -> Logger
Log is processed, including duplication, but not written to any destination.
This can be useful e.g. for running application tests with all log-levels active and still avoiding tons of log files etc. Such tests ensure that the log calls which are normally not active will not cause undesired side-effects when activated (note that the log macros may prevent arguments of inactive log-calls from being evaluated).
Or, if you want to get logs both to stdout and stderr, but nowhere else,
then use this option and combine it with
Logger::duplicate_to_stdout
and Logger::duplicate_to_stderr
.
pub fn print_message(self) -> Logger
pub fn print_message(self) -> Logger
Makes the logger print an info message to stdout with the name of the logfile when a logfile is opened for writing.
pub fn duplicate_to_stderr(self, dup: Duplicate) -> Logger
pub fn duplicate_to_stderr(self, dup: Duplicate) -> Logger
Makes the logger write messages with the specified minimum severity additionally to stderr.
Does not work with Logger::log_to_stdout
or Logger::log_to_stderr
.
pub fn duplicate_to_stdout(self, dup: Duplicate) -> Logger
pub fn duplicate_to_stdout(self, dup: Duplicate) -> Logger
Makes the logger write messages with the specified minimum severity additionally to stdout.
Does not work with Logger::log_to_stdout
or Logger::log_to_stderr
.
pub fn format(
self,
format: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
pub fn format(
self,
format: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
Makes the logger use the provided format function for all messages that are written to files, stderr, stdout, or to an additional writer.
You can either choose one of the provided log-line formatters,
or you create and use your own format function with the signature
fn my_format(
write: &mut dyn std::io::Write,
now: &mut flexi_logger::DeferredNow,
record: &log::Record,
) -> std::io::Result<()>
By default, default_format
is used for output to files and to custom writers,
and AdaptiveFormat::Default
is used for output to stderr
and stdout
.
If the feature colors
is switched off, default_format
is used for all outputs.
pub fn format_for_files(
self,
format: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
pub fn format_for_files(
self,
format: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
Makes the logger use the provided format function for messages that are written to files.
Regarding the default, see Logger::format
.
pub fn format_for_stderr(
self,
format_function: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
pub fn format_for_stderr(
self,
format_function: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
Makes the logger use the provided format function for messages that are written to stderr.
Regarding the default, see Logger::format
.
pub fn adaptive_format_for_stderr(
self,
adaptive_format: AdaptiveFormat
) -> Logger
pub fn adaptive_format_for_stderr(
self,
adaptive_format: AdaptiveFormat
) -> Logger
Makes the logger use the specified format for messages that are written to stderr
.
Coloring is used if stderr
is a tty.
Regarding the default, see Logger::format
.
pub fn format_for_stdout(
self,
format_function: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
pub fn format_for_stdout(
self,
format_function: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
Makes the logger use the provided format function to format messages that are written to stdout.
Regarding the default, see Logger::format
.
pub fn adaptive_format_for_stdout(
self,
adaptive_format: AdaptiveFormat
) -> Logger
pub fn adaptive_format_for_stdout(
self,
adaptive_format: AdaptiveFormat
) -> Logger
Makes the logger use the specified format for messages that are written to stdout
.
Coloring is used if stdout
is a tty.
Regarding the default, see Logger::format
.
pub fn format_for_writer(
self,
format: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
pub fn format_for_writer(
self,
format: fn(&mut dyn Write, &mut DeferredNow, &Record<'_>) -> Result<(), Error>
) -> Logger
Allows specifying a format function for an additional writer. Note that it is up to the implementation of the additional writer whether it evaluates this setting or not.
Regarding the default, see Logger::format
.
pub fn set_palette(self, palette: String) -> Logger
pub fn set_palette(self, palette: String) -> Logger
Sets the color palette for function style
, which is used in the
provided coloring format functions.
The palette given here overrides the default palette.
The palette is specified in form of a String that contains a semicolon-separated list
of numbers (0..=255) and/or dashes (´-´).
The first five values denote the fixed color that is
used for coloring error
, warn
, info
, debug
, and trace
messages.
The String "196;208;-;7;8"
describes the default palette, where color 196 is
used for error messages, and so on. The -
means that no coloring is done,
i.e., with "-;-;-;-;-"
all coloring is switched off.
Prefixing a number with ‘b’ makes the output being written in bold.
The String "b1;3;2;4;6"
e.g. describes the palette used by env_logger
.
The palette can further be overridden at runtime by setting the environment variable
FLEXI_LOGGER_PALETTE
to a palette String. This allows adapting the used text colors to
differently colored terminal backgrounds.
For your convenience, if you want to specify your own palette,
you can produce a colored list with all 255 colors with cargo run --example colors
.
pub fn rotate(
self,
criterion: Criterion,
naming: Naming,
cleanup: Cleanup
) -> Logger
pub fn rotate(
self,
criterion: Criterion,
naming: Naming,
cleanup: Cleanup
) -> Logger
Prevent indefinite growth of the log file by applying file rotation and a clean-up strategy for older log files.
By default, the log file is fixed while your program is running and will grow indefinitely. With this option being used, when the log file reaches the specified criterion, the file will be closed and a new file will be opened.
Note that also the filename pattern changes:
- by default, no timestamp is added to the filename if rotation is used
- the logs are always written to a file with infix
_rCURRENT
- when the rotation criterion is fulfilled, it is closed and renamed to a file
with another infix (see
Naming
), and then the logging continues again to the (fresh) file with infix_rCURRENT
.
Example:
After some logging with your program my_prog
and rotation with Naming::Numbers
,
you will find files like
my_prog_r00000.log
my_prog_r00001.log
my_prog_r00002.log
my_prog_rCURRENT.log
Parameters
criterion
defines when the log file should be rotated, based on its size or age.
See Criterion
for details.
naming
defines the naming convention for the rotated log files.
See Naming
for details.
cleanup
defines the strategy for dealing with older files.
See Cleanup
for details.
pub fn cleanup_in_background_thread(self, use_background_thread: bool) -> Logger
pub fn cleanup_in_background_thread(self, use_background_thread: bool) -> Logger
When Logger::rotate
is used with some Cleanup
variant other than Cleanup::Never
,
then this method can be used to define
if the cleanup activities (finding files, deleting files, evtl compressing files) are
delegated to a background thread (which is the default,
to minimize the blocking impact to your application caused by IO operations),
or whether they are done synchronously in the current log-call.
If you call this method with use_background_thread = false
,
the cleanup is done synchronously.
pub fn filter(
self,
filter: Box<dyn LogLineFilter + Send + Sync + 'static, Global>
) -> Logger
pub fn filter(
self,
filter: Box<dyn LogLineFilter + Send + Sync + 'static, Global>
) -> Logger
Apply the provided filter before really writing log lines.
See the documentation of module filter
for a usage example.
pub fn append(self) -> Logger
pub fn append(self) -> Logger
Makes the logger append to the specified output file, if it exists already; by default, the file would be truncated.
This option only has an effect if logs are written to files, but
it will hardly make an effect if FileSpec::suppress_timestamp
is not used.
pub fn create_symlink<P>(self, symlink: P) -> Logger where
P: Into<PathBuf>,
pub fn create_symlink<P>(self, symlink: P) -> Logger where
P: Into<PathBuf>,
The specified path will be used on unix systems to create a symbolic link to the current log file.
This option has no effect on filesystems where symlinks are not supported, and it only has an effect if logs are written to files.
Example
You can use the symbolic link to follow the log output with tail
,
even if the log files are rotated.
Assuming you use create_symlink("link_to_log_file")
, then use:
tail --follow=name --max-unchanged-stats=1 --retry link_to_log_file
pub fn add_writer<S>(
self,
target_name: S,
writer: Box<dyn LogWriter + 'static, Global>
) -> Logger where
S: Into<String>,
pub fn add_writer<S>(
self,
target_name: S,
writer: Box<dyn LogWriter + 'static, Global>
) -> Logger where
S: Into<String>,
pub fn write_mode(self, write_mode: WriteMode) -> Logger
pub fn write_mode(self, write_mode: WriteMode) -> Logger
Sets the write mode for the logger.
See WriteMode
for more (important!) details.
pub fn use_windows_line_ending(self) -> Logger
pub fn use_windows_line_ending(self) -> Logger
Use Windows line endings, rather than just \n
.
pub fn error_channel(self, error_channel: ErrorChannel) -> Logger
pub fn error_channel(self, error_channel: ErrorChannel) -> Logger
Define the output channel for flexi_logger
’s own error messages.
These are only written if flexi_logger
cannot do what it is supposed to do,
so under normal circumstances no single message shuld appear.
By default these error messages are printed to stderr
.
impl Logger
impl Logger
Alternative set of methods to control the behavior of the Logger.
Use these methods when you want to control the settings flexibly,
e.g. with commandline arguments via docopts
or clap
.
pub fn o_print_message(self, print_message: bool) -> Logger
pub fn o_print_message(self, print_message: bool) -> Logger
With true, makes the logger print an info message to stdout, each time when a new file is used for log-output.
pub fn o_rotate(
self,
rotate_config: Option<(Criterion, Naming, Cleanup)>
) -> Logger
pub fn o_rotate(
self,
rotate_config: Option<(Criterion, Naming, Cleanup)>
) -> Logger
By default, and with None, the log file will grow indefinitely.
If a rotate_config
is set, when the log file reaches or exceeds the specified size,
the file will be closed and a new file will be opened.
Also the filename pattern changes: instead of the timestamp, a serial number
is included into the filename.
The size is given in bytes, e.g. o_rotate_over_size(Some(1_000))
will rotate
files once they reach a size of 1 kB.
The cleanup strategy allows delimiting the used space on disk.
pub fn o_append(self, append: bool) -> Logger
pub fn o_append(self, append: bool) -> Logger
If append is set to true, makes the logger append to the specified output file, if it exists. By default, or with false, the file would be truncated.
This option only has an effect if logs are written to files,
and it will hardly make an effect if suppress_timestamp()
is not used.
pub fn o_create_symlink<P>(self, symlink: Option<P>) -> Logger where
P: Into<PathBuf>,
pub fn o_create_symlink<P>(self, symlink: Option<P>) -> Logger where
P: Into<PathBuf>,
If a String is specified, it will be used on unix systems to create in the current folder a symbolic link with this name to the current log file.
This option only has an effect on unix systems and if logs are written to files.
impl Logger
impl Logger
Finally, start logging, optionally with a spec-file.
pub fn start(self) -> Result<LoggerHandle, FlexiLoggerError>
pub fn start(self) -> Result<LoggerHandle, FlexiLoggerError>
Consumes the Logger object and initializes flexi_logger
.
Keep the LoggerHandle
alive up to the very end of your program!
Dropping the LoggerHandle
flushes and shuts down FileLogWriter
s
and other LogWriter
s, and then may prevent further logging!
This should happen immediately before the program terminates, but not earlier.
Dropping the LoggerHandle
is uncritical
only with Logger::log_to_stdout
or Logger::log_to_stderr
.
The LoggerHandle
also allows updating the log specification programmatically,
e.g. to intensify logging for (buggy) parts of a (test) program, etc.
Example
use flexi_logger::{Logger,WriteMode, FileSpec};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let _logger = Logger::try_with_str("info")?
.log_to_file(FileSpec::default())
.write_mode(WriteMode::BufferAndFlush)
.start()?;
// ... do all your work and join back all threads whose logs you want to see ...
Ok(())
}
Errors
Several variants of FlexiLoggerError
can occur.
pub fn build(
self
) -> Result<(Box<dyn Log + 'static, Global>, LoggerHandle), FlexiLoggerError>
pub fn build(
self
) -> Result<(Box<dyn Log + 'static, Global>, LoggerHandle), FlexiLoggerError>
Builds a boxed logger and a LoggerHandle
for it,
but does not initialize the global logger.
The returned boxed logger implements the Log
trait
and can be installed manually or nested within another logger.
Keep the LoggerHandle
alive up to the very end of your program!
See Logger::start
for more details.
Errors
Several variants of FlexiLoggerError
can occur.
pub fn start_with_specfile<P>(
self,
specfile: P
) -> Result<LoggerHandle, FlexiLoggerError> where
P: AsRef<Path>,
pub fn start_with_specfile<P>(
self,
specfile: P
) -> Result<LoggerHandle, FlexiLoggerError> where
P: AsRef<Path>,
Consumes the Logger object and initializes flexi_logger
in a way that
subsequently the log specification can be updated,
while the program is running, by editing a file.
Uses the spec that was given to the factory method (Logger::with
etc)
as initial spec and then tries to read the logspec from a file.
If the file does not exist, flexi_logger
creates the file and fills it
with the initial spec (and in the respective file format, of course).
Keep the returned LoggerHandle
alive up to the very end of your program!
See Logger::start
for more details.
Feature dependency
The implementation of this configuration method uses some additional crates
that you might not want to depend on with your program if you don’t use this functionality.
For that reason the method is only available if you activate the
specfile
feature. See the usage section on
crates.io for details.
Usage
A logger initialization like
use flexi_logger::Logger;
Logger::try_with_str("info")
.unwrap()
// more logger configuration
.start_with_specfile("logspecification.toml");
will create the file logspecification.toml
(if it does not yet exist) with this content:
## Optional: Default log level
global_level = 'info'
## Optional: specify a regular expression to suppress all messages that don't match
#global_pattern = 'foo'
## Specific log levels per module are optionally defined in this section
[modules]
#'mod1' = 'warn'
#'mod2' = 'debug'
#'mod2::mod3' = 'trace'
You can subsequently edit and modify the file according to your needs, while the program is running, and it will immediately take your changes into account.
Currently only toml-files are supported, the file suffix thus must be .toml
.
The initial spec remains valid if the file cannot be read.
If you update the specfile subsequently while the program is running, flexi_logger
re-reads it automatically and adapts its behavior according to the new content.
If the file cannot be read anymore, e.g. because the format is not correct, the
previous logspec remains active.
If the file is corrected subsequently, the log spec update will work again.
Errors
Several variants of FlexiLoggerError
can occur.
pub fn build_with_specfile<P>(
self,
specfile: P
) -> Result<(Box<dyn Log + 'static, Global>, LoggerHandle), FlexiLoggerError> where
P: AsRef<Path>,
pub fn build_with_specfile<P>(
self,
specfile: P
) -> Result<(Box<dyn Log + 'static, Global>, LoggerHandle), FlexiLoggerError> where
P: AsRef<Path>,
Builds a boxed logger and a LoggerHandle
for it,
but does not initialize the global logger.
See also Logger::start
and Logger::start_with_specfile
.
for the properties of the returned logger.
Errors
Several variants of FlexiLoggerError
can occur.
Auto Trait Implementations
impl !RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl !UnwindSafe for Logger
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> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
impl<A> DynCastExt for A
impl<A> DynCastExt for A
fn dyn_cast<T>(
self
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source> where
A: DynCastExtHelper<T>,
T: ?Sized,
fn dyn_cast<T>(
self
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source> where
A: DynCastExtHelper<T>,
T: ?Sized,
Use this to cast from one trait object type to another. Read more
fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target where
A: DynCastExtAdvHelper<T, T, Source = <A as DynCastExtAdvHelper<T, T>>::Target>,
T: ?Sized,
fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target where
A: DynCastExtAdvHelper<T, T, Source = <A as DynCastExtAdvHelper<T, T>>::Target>,
T: ?Sized,
Use this to upcast a trait to one of its supertraits. Read more
fn dyn_cast_adv<F, T>(
self
) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source> where
A: DynCastExtAdvHelper<F, T>,
F: ?Sized,
T: ?Sized,
fn dyn_cast_adv<F, T>(
self
) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source> where
A: DynCastExtAdvHelper<F, T>,
F: ?Sized,
T: ?Sized,
fn dyn_cast_with_config<C>(
self
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source> where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
fn dyn_cast_with_config<C>(
self
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source> where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
Use this to cast from one trait object type to another. With this method the type parameter is a config type that uniquely specifies which cast should be preformed. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more