Skip to main content

LogConfig

Struct LogConfig 

Source
pub struct LogConfig {
Show 39 fields pub read_buffer_cap: ByteSize, pub read_ahead_max: ByteSize, pub timestamp_scan_window: ByteSize, pub segment_size: ByteSize, pub segment_roll_interval: Time, pub segment_jitter: Time, pub file_delete_delay: Time, pub start_offset_checkpoint_interval: Time, pub flush_messages: Option<u64>, pub flush_interval: Option<Time>, pub compression_gzip_level: i32, pub compression_lz4_level: i32, pub compression_zstd_level: i32, pub retention: Option<Time>, pub retention_size: Option<ByteSize>, pub max_message_size: ByteSize, pub max_decompressed_record: Option<ByteSize>, pub index_interval: ByteSize, pub segment_index_size: ByteSize, pub flush_on_append: bool, pub segment_allocation: SegmentAllocation, pub tail_cache_size: ByteSize, pub writeback_window: ByteSize, pub page_cache_budget: Option<ByteSize>, pub validate_on_open: bool, pub cleanup_policy: CleanupPolicy, pub min_compaction_lag: Time, pub max_compaction_lag: Option<Time>, pub min_cleanable_dirty_ratio: Ratio, pub message_timestamp_type: TimestampType, pub compression_type: Option<CompressionType>, pub remote_storage_enable: bool, pub remote_tier: RemoteTierFlags, pub local_retention: Option<Time>, pub local_retention_size: Option<ByteSize>, pub delete_retention: Time, pub delivery_policy: DeliveryPolicy, pub schedule_order: ScheduleOrder, pub delivery_clock_uncertainty: Time,
}
Expand description

Tunables for Log behavior.

Defaults match Apache Kafka 4.2 for segment.bytes, segment.ms, retention.ms, index.interval.bytes, and the other tunables. Start from the Default impl. Most production deployments override only Self::retention and Self::retention_size.

Fields§

§read_buffer_cap: ByteSize

Cap the initial allocation used by decoded and raw segment reads.

§read_ahead_max: ByteSize

How far past a verbatim read’s own window the read asks the kernel to read ahead, as a POSIX_FADV_WILLNEED hint, so a consumer that is behind finds its next fetch in the page cache. The hint covers the window and then up to one more window, capped at this. 0 hints only the window itself. The broker gives the hint as one WILLNEED call for each 128 KiB of the range, because Linux reads only about max(max_sectors_kb, read_ahead_kb) of one call. The hint is a no-op off Linux.

§timestamp_scan_window: ByteSize

Read timestamp searches in windows of this size.

§segment_size: ByteSize

Roll the active segment once it grows past this. Kafka’s segment.bytes; default 1 GiB.

§segment_roll_interval: Time

Roll the active segment when its first record is older than this. Kafka’s segment.ms; default 7 days.

§segment_jitter: Time

Maximum random subtraction from the segment roll interval, sampled per segment.

§file_delete_delay: Time

Delay before retired segment files are unlinked. Readers stop seeing them immediately.

§start_offset_checkpoint_interval: Time

How long a log start that only retention moved may wait before it is written to log-start-offset-checkpoint. Kafka’s broker-wide log.flush.start.offset.checkpoint.interval.ms; default one minute. Zero writes the start on the next maintenance pass. Retention moves the start to a segment boundary, which the segment names already record, so the write can wait: see Log::checkpoint_log_start_if_due.

§flush_messages: Option<u64>

Offset span between forced syncs. None disables the threshold.

§flush_interval: Option<Time>

Time between forced syncs of dirty data. None disables the timer.

§compression_gzip_level: i32

Gzip level used when encoding owned batches; -1 selects the codec default.

§compression_lz4_level: i32

Lz4 level used when encoding owned batches.

§compression_zstd_level: i32

Zstd level used when encoding owned batches.

§retention: Option<Time>

Delete sealed segments older than this. None = unlimited. Kafka’s retention.ms; default 7 days.

§retention_size: Option<ByteSize>

Delete oldest sealed segments until the total .log size fits. None = unlimited. Kafka’s retention.bytes.

§max_message_size: ByteSize

Largest single record batch this partition accepts, measured over the batch’s whole wire encoding including its 61-byte v2 header. Kafka’s max.message.bytes; default 1048588. A Produce carrying a larger batch is refused with MESSAGE_TOO_LARGE (10) rather than truncated, because a batch that lands in the log is a batch every consumer has to fetch whole.

§max_decompressed_record: Option<ByteSize>

Kafka trunk’s max.decompressed.message.bytes: the largest record body a compressed batch may hold when the log decompresses it, which it does to compact a partition and to answer a by-timestamp ListOffsets. A record above it fails the lookup or the pass with LogError::RecordTooLarge, as DefaultRecord.readFrom throws InvalidRecordException. An uncompressed batch is never held to it. None is no limit, which is Kafka’s default (Records.SOFT_MAX_ARRAY_LENGTH) and the only setting Kafka 4.3.1 has: the broker sets it only under unstable.api.versions.enable.

§index_interval: ByteSize

Write one .index/.timeindex entry per this much .log. Kafka’s index.interval.bytes; default 4 KiB.

§segment_index_size: ByteSize

Roll the active segment once its .index or its .timeindex holds this many bytes of entries. Kafka’s segment.index.bytes; default 10 MiB. Kafka rounds the size down to whole entries, so the offset index holds size / 8 entries and the time index size / 12.

§flush_on_append: bool

fsync after every append. Default off. The broker manages fsync separately.

§segment_allocation: SegmentAllocation

Kafka’s preallocate. Defaults to SegmentAllocation::OnWrite, Kafka’s false. See SegmentAllocation.

§tail_cache_size: ByteSize

How much of the newest data an active segment that writes through O_DIRECT keeps in memory to serve reads with. Those writes bypass the page cache and drop what it held of the range, so without this a consumer reading right behind the producer reads from disk. Every partition under SegmentAllocation::Preallocate holds up to this much, plus one batch; 0 keeps only the newest batch. Default 8 MiB: see DEFAULT_TAIL_CACHE_SIZE.

§writeback_window: ByteSize

In a segment written through the page cache, start a background fdatasync of the active .log file after every this many appended bytes, and make an append wait while two such syncs are still running. The kernel then holds about twice this much dirty data for the segment at most, so neither its dirty-page throttling, which pauses a writer for up to 200 ms at a time, nor the sync at segment roll holds an append for long. A segment written through O_DIRECT needs none of this, and flush_on_append syncs every append anyway. 0 leaves write-back to the kernel. Default 8 MiB: see DEFAULT_WRITEBACK_WINDOW.

§page_cache_budget: Option<ByteSize>

The most page cache the segments written through it keep, over every log in the process. Each background sync of an active segment records the whole pages it covered, and while the recorded bytes exceed this, the oldest recorded pages of any log are dropped from the page cache (posix_fadvise(POSIX_FADV_DONTNEED)), off the appending thread. A consumer further behind than this reads from the disk. Without it, a container’s memory limit is what evicts the pages, and at that limit the kernel reclaims a page inside every append that writes one: in 10 GiB containers taking 50K 1 KiB records/s at RF3, that doubled the publish p50 for minutes at a time. None keeps every page until the kernel evicts it. Logs with different values each trim the shared record to their own. Segments written through O_DIRECT keep no page cache and are not counted. Default None; the broker sets half of its memory limit.

§validate_on_open: bool

On open, CRC every batch in the active segment and rebuild its sparse indexes.

§cleanup_policy: CleanupPolicy

Cleanup policy. Defaults to Delete. See CleanupPolicy.

§min_compaction_lag: Time

Kafka’s min.compaction.lag.ms: a record stays uncompacted for at least this long after it is written. The broker’s cleaner reads it and leaves a partition whose newest dirty record is younger than this alone. Default 0, which is Kafka’s.

§max_compaction_lag: Option<Time>

Kafka’s max.compaction.lag.ms: however clean a partition looks, once its oldest dirty record is older than this the cleaner runs anyway. None is no bound, which is Kafka’s default (Long.MAX_VALUE).

§min_cleanable_dirty_ratio: Ratio

Kafka’s min.cleanable.dirty.ratio: the share of a compacted partition’s log that must be uncleaned before the cleaner spends a pass on it. Default 0.5, which is Kafka’s.

§message_timestamp_type: TimestampType

Kafka’s message.timestamp.type: whose clock the stored records carry. CreateTime is the producer’s own timestamp and is the default; LogAppendTime is the broker’s clock at append time.

§compression_type: Option<CompressionType>

Broker-side recompression target. None is Kafka’s compression.type=producer, which is pass-through: the broker stores the batch exactly as the producer sent it. Some(c) re-encodes every batch the broker accepts on this partition to c before the write. This matches Kafka’s per-topic compression.type config. gzip, snappy, lz4, zstd, and uncompressed map to Some(_). producer, the default, maps to None.

§remote_storage_enable: bool

When true, the broker’s RemoteLogManager may copy this partition’s sealed segments (KIP-405) to the remote tier. This maps to Kafka’s per-topic remote.storage.enable. Default false, which is also Kafka’s default, because tiered storage is opt-in per topic.

§remote_tier: RemoteTierFlags

KIP-950’s two disablement controls, remote.log.copy.disable and remote.log.delete.on.disable. See RemoteTierFlags.

§local_retention: Option<Time>

Local-disk time-retention window for tiered partitions (KIP-405). None inherits Self::retention. Default None.

§local_retention_size: Option<ByteSize>

Local-disk size budget for tiered partitions (KIP-405). None inherits Self::retention_size. Default None.

§delete_retention: Time

KIP-534. After a tombstone or transaction marker first becomes compaction-eligible, the log retains it for at least this long before deletion. This is the delete-horizon grace window. Default 24h.

§delivery_policy: DeliveryPolicy

When a durable record becomes visible. Defaults to DeliveryPolicy::Immediate. See DeliveryPolicy.

§schedule_order: ScheduleOrder

KFC-1 delivery.schedule.monotonic, read only under DeliveryPolicy::Scheduled. See ScheduleOrder.

The check belongs to the log because only the log serializes appends. A partition’s schedule is a property of what it already holds, so a test that reads it and an append that extends it have to be the same critical section: two producers that each pass a check taken before the append can still land out of order, and so can two jobs the writer batches into one group. Kafka runs its own record-shape rejections in the same place, under UnifiedLog.append’s lock.

§delivery_clock_uncertainty: Time

Declared bound on how far this broker’s clock can be from true time. Default 250 ms. It has an effect only under DeliveryPolicy::Scheduled.

A batch is visible once max_timestamp + delivery_clock_uncertainty <= now. If the clock reads c while true time is somewhere in [c - e, c + e], then c >= activation + e proves true time has reached the activation instant. Provided the declared bound holds, this test does not deliver early. The clock test’s additional delay is at most twice the bound; polling, unavailable storage and an earlier pending batch can delay delivery further.

Changes are prospective for the published delivery prefix: increasing this bound or moving the clock backward does not retract offsets the in-memory watermark already released. The new bound governs subsequent advances and pending batches. A restart rebuilds that watermark from retained records using the current bound; the watermark is not durable.

Implementations§

Source§

impl LogConfig

Source

pub fn compression_level(&self, codec: CompressionType) -> Option<i32>

The configured level for a codec that supports compression levels.

Trait Implementations§

Source§

impl Clone for LogConfig

Source§

fn clone(&self) -> LogConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LogConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LogConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for LogConfig

Source§

fn eq(&self, other: &LogConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LogConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<F> FnGhost for F

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Paint for T
where T: ?Sized,

§

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 primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

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>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

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 bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

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 mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

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.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

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);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more