Skip to main content

Producer

Struct Producer 

Source
pub struct Producer { /* private fields */ }

Implementations§

Source§

impl Producer

Source

pub async fn start( bootstrap: String, client_id: Option<String>, compression: Compression, compression_gzip_level: i32, compression_lz4_level: i32, compression_zstd_level: i32, enable_idempotence: Option<bool>, acks: Acks, linger: Duration, batch_size: usize, partitioner_ignore_keys: bool, partitioner_adaptive_partitioning_enable: bool, partitioner_availability_timeout: Duration, partitioner: Option<Arc<dyn Partitioner>>, client_rack: Option<String>, partitioner_rack_aware: bool, dns_timeout: Time, client_dns_lookup: ClientDnsLookup, reconnect_backoff: Time, reconnect_backoff_max: Time, connections_max_idle: Time, socket_connection_setup_timeout: Time, socket_connection_setup_timeout_max: Time, dispatch_queue_capacity: usize, frame_max: ByteSize, send_buffer: Option<ByteSize>, receive_buffer: Option<ByteSize>, request_timeout: Duration, flush_timeout: Duration, retries: i32, retry_backoff: Duration, retry_backoff_max: Duration, delivery_timeout: Option<Duration>, init_retry_timeout: Duration, max_in_flight_per_connection: usize, max_block: Duration, metadata_max_age: Duration, metadata_max_idle: Duration, buffer_memory: usize, max_request_size: usize, metadata_recovery_strategy: MetadataRecoveryStrategy, metadata_recovery_rebootstrap_trigger: Time, transactional_id: Option<String>, transaction_timeout: Option<Duration>, transaction_two_phase_commit_enable: bool, security: Option<ClientSecurity>, enable_metrics_push: bool, ) -> Result<Self, ProducerError>

Build a Producer pointed at the given bootstrap address.

The defaults are Kafka’s: acks=All, a linger of 5 ms, and idempotence on. The builder applies the rules of Kafka’s ProducerConfig. When enable_idempotence is not set, retries=0 or an acks other than All turns idempotence off. When it is set to true, those settings fail with ProducerError::InvalidConfig. An idempotent producer accepts at most 5 in-flight requests per connection, and a transactional_id requires idempotence.

enable_metrics_push (Kafka’s enable.metrics.push, default true) pushes the client metrics that a broker’s client metrics subscription names (KIP-714), with a terminating push on close. When it is false, the producer sends neither GetTelemetrySubscriptions nor PushTelemetry.

send fails a record whose serialized size is larger than max_request_size (default 1 MiB, Kafka’s max.request.size) or larger than buffer_memory with ProducerError::RecordTooLarge, and sends no request for it.

compression_gzip_level, compression_lz4_level and compression_zstd_level take Kafka’s defaults (-1, 9 and 3) and ranges (KIP-390), and build fails with ProducerError::InvalidConfig for a level out of range. Each batch of a gzip, lz4 or zstd producer is compressed at the level of its codec. The lz4 codec has no high compression mode, so every lz4 level gives the same output (krabka-io/krabka-protocol#27).

When client_id is not set, the client id is producer-<transactional_id>, or producer-<n> with a process-wide sequence number.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source

pub fn builder() -> ProducerStartBuilder

Build a Producer pointed at the given bootstrap address.

The defaults are Kafka’s: acks=All, a linger of 5 ms, and idempotence on. The builder applies the rules of Kafka’s ProducerConfig. When enable_idempotence is not set, retries=0 or an acks other than All turns idempotence off. When it is set to true, those settings fail with ProducerError::InvalidConfig. An idempotent producer accepts at most 5 in-flight requests per connection, and a transactional_id requires idempotence.

enable_metrics_push (Kafka’s enable.metrics.push, default true) pushes the client metrics that a broker’s client metrics subscription names (KIP-714), with a terminating push on close. When it is false, the producer sends neither GetTelemetrySubscriptions nor PushTelemetry.

send fails a record whose serialized size is larger than max_request_size (default 1 MiB, Kafka’s max.request.size) or larger than buffer_memory with ProducerError::RecordTooLarge, and sends no request for it.

compression_gzip_level, compression_lz4_level and compression_zstd_level take Kafka’s defaults (-1, 9 and 3) and ranges (KIP-390), and build fails with ProducerError::InvalidConfig for a level out of range. Each batch of a gzip, lz4 or zstd producer is compressed at the level of its codec. The lz4 codec has no high compression mode, so every lz4 level gives the same output (krabka-io/krabka-protocol#27).

When client_id is not set, the client id is producer-<transactional_id>, or producer-<n> with a process-wide sequence number.

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source§

impl Producer

Source

pub fn producer_id(&self) -> i64

Source

pub fn producer_epoch(&self) -> i16

Source

pub async fn transactional_identity(&self) -> Option<(i64, i16)>

Give the identity that the transaction coordinator minted for this producer’s transactional.id.

Producer::init_transactions sets this pair, and the broker fences a write that carries an older one. It is the fencing token of the transactional flow.

This is not the pair that Producer::producer_id and Producer::producer_epoch report. Those come from the idempotent InitProducerId that the builder sends with no transactional id, and the coordinator never advances them.

Returns None before init_transactions runs, and for a producer that carries no transactional_id.

Source

pub async fn begin_transaction(&self) -> Result<Transaction<'_>, ProducerError>

Begin a new transaction, returning a borrowed guard that must be finished with Transaction::commit or Transaction::abort.

The caller must call this after init_transactions has completed, and before any transactional send call. It transitions the producer from Ready to InTransaction.

§Errors
Source

pub async fn begin_transaction_owned( self: Arc<Self>, ) -> Result<OwnedTransaction, ProducerError>

Begin a new transaction, returning an owning guard that must be finished with OwnedTransaction::commit or OwnedTransaction::abort.

The semantics are identical to begin_transaction, but the returned guard owns an Arc<Producer> instead of borrowing &self. Use it when the guard must survive across an owned or 'static boundary that a borrow cannot, for example when it is stored behind a dyn Trait object. It mirrors tokio::sync::Mutex::lock_owned.

§Errors

Same as begin_transaction.

Source

pub async fn prepare_transaction( &self, ) -> Result<PreparedTransactionState, ProducerError>

Flushes the current transaction and locks it against further writes.

The returned identity has a stable Kafka-compatible string form and can be persisted by an external transaction coordinator. After this method succeeds, only commit, abort, or complete_transaction may finish the transaction.

§Errors
Source

pub async fn complete_transaction( &self, prepared: PreparedTransactionState, ) -> Result<(), ProducerError>

Completes the current prepared transaction.

A token matching the prepared transaction commits it. A stale, empty, or otherwise different token aborts it, so recovery never commits work that belongs to another producer incarnation.

§Errors

Returns ProducerError::InvalidTransactionState unless a local prepare_transaction or init_transactions_with_keep_prepared established a prepared transaction. Other failures are the same as committing or aborting a normal transaction.

Source

pub async fn init_transactions(&self) -> Result<(), ProducerError>

Initialize the transactional producer.

The caller must call this before any transactional operation. It discovers the transaction coordinator with FindCoordinator, opens a dedicated connection to it, and calls InitProducerId to get a fenced (producer_id, producer_epoch) pair.

Like Kafka’s initTransactions, it blocks while the coordinator is not ready. A lookup that answers a retriable code, such as COORDINATOR_NOT_AVAILABLE from a broker that is still creating __transaction_state, or that fails in transport, goes out again. The producer-ID initialization retry timeout bounds the lookup and InitProducerId together.

§Errors
  • ProducerError::NotTransactional — transactional_id was not set.
  • ProducerError::InvalidTransactionState — called while a transaction is in flight.
  • ProducerError::FencedProducer — the broker returned INVALID_PRODUCER_EPOCH (47) or PRODUCER_FENCED (90), now or in an earlier transactional operation.
  • ProducerError::FatalTransactionError — the coordinator answered with a fatal code, now or in an earlier transactional operation. A FindCoordinator answer of TRANSACTIONAL_ID_AUTHORIZATION_FAILED, or of a code that Kafka’s FindCoordinatorHandler does not expect, is fatal. Kafka’s initTransactions does not clear a fatal error either: close the producer.
  • ProducerError::Server — an abortable code (TRANSACTIONAL_ID_AUTHORIZATION_FAILED or CLUSTER_AUTHORIZATION_FAILED from InitProducerId, or TRANSACTION_ABORTABLE), or a retriable code at the retry deadline. The call can be made again.
  • ProducerError::Client — transport-level failure, at once when it repeats on every attempt, such as a failed authentication, or at the retry deadline.
Source

pub async fn init_transactions_with_keep_prepared( &self, keep_prepared: bool, ) -> Result<(), ProducerError>

Initializes the producer and optionally preserves an ongoing prepared transaction from an earlier producer incarnation.

When keep_prepared is true and the broker reports an ongoing transaction, the producer enters the prepared state. The only allowed transaction-ending operations are commit, abort, and complete_transaction. The broker returns both identities: the original identity becomes the persisted comparison token, while the newly staged identity is used for the eventual EndTxn.

§Errors

The errors are the same as init_transactions.

Source

pub async fn send_offsets_to_transaction( &self, offsets: impl IntoIterator<Item = ((String, i32), i64)>, group_meta: &ConsumerGroupMetadata, ) -> Result<(), ProducerError>

Enroll a consumer group’s offsets in the current transaction, and fence zombie producers with the supplied ConsumerGroupMetadata, as KIP-447 defines.

It first waits for metadata that names the topics of offsets, as Kafka’s producer does, so that TxnOffsetCommit can name each topic by its id. Then it does two broker round-trips:

  1. AddOffsetsToTxn to the transaction coordinator. This registers the group offset commit as part of the ongoing transaction.
  2. TxnOffsetCommit to the group coordinator. This commits the actual offsets transactionally. It carries the generation, member and instance of group_meta, so the coordinator can fence stale producers.

Each request goes out again after a transport loss and after a retriable code, until the producer-ID initialization retry timeout ends. A code that shows the coordinator moved also finds the coordinator again. The rules follow Kafka’s AddOffsetsToTxnHandler and TxnOffsetCommitHandler.

§Errors
Source

pub async fn send( &self, record: ProducerRecord, ) -> Result<RecordMetadata, ProducerError>

Send a record and wait for its delivery result.

Use Self::enqueue to queue multiple records before waiting for delivery. Once queued, dropping this future does not cancel the record.

§Errors

Returns enqueue or delivery failures as ProducerError.

Source

pub async fn enqueue( &self, record: ProducerRecord, ) -> Result<DeliveryHandle, ProducerError>

Enqueue a record and return a future that resolves when the broker acks, or when the producer fences or closes.

A record with a negative partition or timestamp fails at once with ProducerError::InvalidPartition or ProducerError::InvalidTimestamp, and the producer sends nothing.

A transactional producer fails the record at once, and sends nothing, when its transaction holds an error: the abortable error until the application aborts, and the fatal error for good. Kafka’s KafkaProducer.doSend fails the same way in TransactionManager.maybeAddPartition.

Waits for metadata and buffer space for at most max_block before queueing. Dropping the returned handle does not cancel delivery.

§Errors

Returns validation, producer state, metadata, or buffer allocation failures before queueing. Delivery errors are returned by the handle.

Source

pub async fn close(self) -> Result<(), ProducerError>

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Source

pub async fn client_instance_id( &self, timeout: Time, ) -> Result<Option<Uuid>, ProducerError>

The client instance id that the broker assigned for metrics push (KIP-714), as Kafka’s KafkaProducer.clientInstanceId returns it.

The call waits up to timeout for the first GetTelemetrySubscriptions response. It returns Ok(None) when none has come by then, as Kafka returns null. A zero timeout does not wait.

§Errors

Returns ClientError::TelemetryDisabled when enable_metrics_push is false, and ClientError::InvalidArgument for a negative timeout, as Kafka throws an IllegalStateException and an IllegalArgumentException.

Source

pub async fn flush(&self) -> Result<(), ProducerError>

§Errors

Returns an error when configuration is invalid, protocol encoding fails, the broker rejects the request, or transport I/O fails.

Trait Implementations§

Source§

impl Debug for Producer

Source§

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

Formats the value using the given formatter. Read more

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> 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, 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