pub enum EthRequest {
Show 120 variants
Web3ClientVersion(()),
Web3Sha3(Bytes),
EthChainId(()),
EthNetworkId(()),
NetListening(()),
EthGasPrice(()),
EthMaxPriorityFeePerGas(()),
EthBlobBaseFee(()),
EthAccounts(()),
EthBlockNumber(()),
EthGetBalance(Address, Option<BlockId>),
EthGetAccount(Address, Option<BlockId>),
EthGetStorageAt(Address, U256, Option<BlockId>),
EthGetBlockByHash(B256, bool),
EthGetBlockByNumber(BlockNumberOrTag, bool),
EthGetTransactionCount(Address, Option<BlockId>),
EthGetTransactionCountByHash(B256),
EthGetTransactionCountByNumber(BlockNumberOrTag),
EthGetUnclesCountByHash(B256),
EthGetUnclesCountByNumber(BlockNumberOrTag),
EthGetCodeAt(Address, Option<BlockId>),
EthGetProof(Address, Vec<B256>, Option<BlockId>),
EthSign(Address, Bytes),
PersonalSign(Bytes, Address),
EthSignTransaction(Box<WithOtherFields<TransactionRequest>>),
EthSignTypedData(Address, Value),
EthSignTypedDataV3(Address, Value),
EthSignTypedDataV4(Address, TypedData),
EthSendTransaction(Box<WithOtherFields<TransactionRequest>>),
EthSendRawTransaction(Bytes),
EthCall(WithOtherFields<TransactionRequest>, Option<BlockId>, Option<StateOverride>),
EthCreateAccessList(WithOtherFields<TransactionRequest>, Option<BlockId>),
EthEstimateGas(WithOtherFields<TransactionRequest>, Option<BlockId>, Option<StateOverride>),
EthGetTransactionByHash(TxHash),
EthGetTransactionByBlockHashAndIndex(TxHash, Index),
EthGetTransactionByBlockNumberAndIndex(BlockNumberOrTag, Index),
EthGetRawTransactionByHash(TxHash),
EthGetRawTransactionByBlockHashAndIndex(TxHash, Index),
EthGetRawTransactionByBlockNumberAndIndex(BlockNumberOrTag, Index),
EthGetTransactionReceipt(B256),
EthGetBlockReceipts(BlockId),
EthGetUncleByBlockHashAndIndex(B256, Index),
EthGetUncleByBlockNumberAndIndex(BlockNumberOrTag, Index),
EthGetLogs(Filter),
EthNewFilter(Filter),
EthGetFilterChanges(String),
EthNewBlockFilter(()),
EthNewPendingTransactionFilter(()),
EthGetFilterLogs(String),
EthUninstallFilter(String),
EthGetWork(()),
EthSubmitWork(B64, B256, B256),
EthSubmitHashRate(U256, B256),
EthFeeHistory(U256, BlockNumberOrTag, Vec<f64>),
EthSyncing(()),
DebugGetRawTransaction(TxHash),
DebugTraceTransaction(B256, GethDebugTracingOptions),
DebugTraceCall(WithOtherFields<TransactionRequest>, Option<BlockId>, GethDebugTracingCallOptions),
TraceTransaction(B256),
TraceBlock(BlockNumberOrTag),
TraceFilter(TraceFilter),
ImpersonateAccount(Address),
StopImpersonatingAccount(Address),
AutoImpersonateAccount(bool),
GetAutoMine(()),
Mine(Option<U256>, Option<U256>),
SetAutomine(bool),
SetIntervalMining(u64),
GetIntervalMining(()),
DropTransaction(B256),
DropAllTransactions(),
Reset(Option<Params<Option<Forking>>>),
SetRpcUrl(String),
SetBalance(Address, U256),
SetCode(Address, Bytes),
SetNonce(Address, U256),
SetStorageAt(Address, U256, B256),
SetCoinbase(Address),
SetChainId(u64),
SetLogging(bool),
SetMinGasPrice(U256),
SetNextBlockBaseFeePerGas(U256),
EvmSetTime(U256),
DumpState(Option<Params<Option<bool>>>),
LoadState(Bytes),
NodeInfo(()),
AnvilMetadata(()),
EvmSnapshot(()),
EvmRevert(U256),
EvmIncreaseTime(U256),
EvmSetNextBlockTimeStamp(U256),
EvmSetBlockGasLimit(U256),
EvmSetBlockTimeStampInterval(u64),
EvmRemoveBlockTimeStampInterval(()),
EvmMine(Option<Params<Option<MineOptions>>>),
EvmMineDetailed(Option<Params<Option<MineOptions>>>),
EthSendUnsignedTransaction(Box<WithOtherFields<TransactionRequest>>),
EnableTraces(()),
TxPoolStatus(()),
TxPoolInspect(()),
TxPoolContent(()),
ErigonGetHeaderByNumber(BlockNumberOrTag),
OtsGetApiLevel(()),
OtsGetInternalOperations(B256),
OtsHasCode(Address, BlockNumberOrTag),
OtsTraceTransaction(B256),
OtsGetTransactionError(B256),
OtsGetBlockDetails(BlockNumberOrTag),
OtsGetBlockDetailsByHash(B256),
OtsGetBlockTransactions(u64, usize, usize),
OtsSearchTransactionsBefore(Address, u64, usize),
OtsSearchTransactionsAfter(Address, u64, usize),
OtsGetTransactionBySenderAndNonce(Address, U256),
OtsGetContractCreator(Address),
RemovePoolTransactions(Address),
Reorg(ReorgOptions),
WalletGetCapabilities(()),
WalletSendTransaction(Box<WithOtherFields<TransactionRequest>>),
AnvilAddCapability(Address),
AnvilSetExecutor(String),
}
Expand description
Represents ethereum JSON-RPC API
Variants§
Web3ClientVersion(())
Web3Sha3(Bytes)
EthChainId(())
EthNetworkId(())
NetListening(())
EthGasPrice(())
EthMaxPriorityFeePerGas(())
EthBlobBaseFee(())
EthAccounts(())
EthBlockNumber(())
EthGetBalance(Address, Option<BlockId>)
EthGetAccount(Address, Option<BlockId>)
EthGetStorageAt(Address, U256, Option<BlockId>)
EthGetBlockByHash(B256, bool)
EthGetBlockByNumber(BlockNumberOrTag, bool)
EthGetTransactionCount(Address, Option<BlockId>)
EthGetTransactionCountByHash(B256)
EthGetTransactionCountByNumber(BlockNumberOrTag)
EthGetUnclesCountByHash(B256)
EthGetUnclesCountByNumber(BlockNumberOrTag)
EthGetCodeAt(Address, Option<BlockId>)
EthGetProof(Address, Vec<B256>, Option<BlockId>)
Returns the account and storage values of the specified account including the Merkle-proof. This call can be used to verify that the data you are pulling from is not tampered with.
EthSign(Address, Bytes)
The sign method calculates an Ethereum specific signature with:
PersonalSign(Bytes, Address)
The sign method calculates an Ethereum specific signature, equivalent to eth_sign: https://docs.metamask.io/wallet/reference/personal_sign/
EthSignTransaction(Box<WithOtherFields<TransactionRequest>>)
EthSignTypedData(Address, Value)
Signs data via EIP-712.
EthSignTypedDataV3(Address, Value)
Signs data via EIP-712.
EthSignTypedDataV4(Address, TypedData)
Signs data via EIP-712, and includes full support of arrays and recursive data structures.
EthSendTransaction(Box<WithOtherFields<TransactionRequest>>)
EthSendRawTransaction(Bytes)
EthCall(WithOtherFields<TransactionRequest>, Option<BlockId>, Option<StateOverride>)
EthCreateAccessList(WithOtherFields<TransactionRequest>, Option<BlockId>)
EthEstimateGas(WithOtherFields<TransactionRequest>, Option<BlockId>, Option<StateOverride>)
EthGetTransactionByHash(TxHash)
EthGetTransactionByBlockHashAndIndex(TxHash, Index)
EthGetTransactionByBlockNumberAndIndex(BlockNumberOrTag, Index)
EthGetRawTransactionByHash(TxHash)
EthGetRawTransactionByBlockHashAndIndex(TxHash, Index)
EthGetRawTransactionByBlockNumberAndIndex(BlockNumberOrTag, Index)
EthGetTransactionReceipt(B256)
EthGetBlockReceipts(BlockId)
EthGetUncleByBlockHashAndIndex(B256, Index)
EthGetUncleByBlockNumberAndIndex(BlockNumberOrTag, Index)
EthGetLogs(Filter)
EthNewFilter(Filter)
Creates a filter object, based on filter options, to notify when the state changes (logs).
EthGetFilterChanges(String)
Polling method for a filter, which returns an array of logs which occurred since last poll.
EthNewBlockFilter(())
Creates a filter in the node, to notify when a new block arrives.
To check if the state has changed, call eth_getFilterChanges
.
EthNewPendingTransactionFilter(())
Creates a filter in the node, to notify when new pending transactions arrive.
To check if the state has changed, call eth_getFilterChanges
.
EthGetFilterLogs(String)
Returns an array of all logs matching filter with given id.
EthUninstallFilter(String)
Removes the filter, returns true if the filter was installed
EthGetWork(())
EthSubmitWork(B64, B256, B256)
EthSubmitHashRate(U256, B256)
EthFeeHistory(U256, BlockNumberOrTag, Vec<f64>)
EthSyncing(())
DebugGetRawTransaction(TxHash)
geth’s debug_getRawTransaction
endpoint
DebugTraceTransaction(B256, GethDebugTracingOptions)
geth’s debug_traceTransaction
endpoint
DebugTraceCall(WithOtherFields<TransactionRequest>, Option<BlockId>, GethDebugTracingCallOptions)
geth’s debug_traceCall
endpoint
TraceTransaction(B256)
Trace transaction endpoint for parity’s trace_transaction
TraceBlock(BlockNumberOrTag)
Trace transaction endpoint for parity’s trace_block
TraceFilter(TraceFilter)
ImpersonateAccount(Address)
send transactions impersonating specific account and contract addresses.
StopImpersonatingAccount(Address)
Stops impersonating an account if previously set with anvil_impersonateAccount
AutoImpersonateAccount(bool)
Will make every account impersonated
GetAutoMine(())
Returns true if automatic mining is enabled, and false.
Mine(Option<U256>, Option<U256>)
Mines a series of blocks
Tuple Fields
SetAutomine(bool)
Enables or disables, based on the single boolean argument, the automatic mining of new blocks with each new transaction submitted to the network.
SetIntervalMining(u64)
Sets the mining behavior to interval with the given interval (seconds)
GetIntervalMining(())
Gets the current mining behavior
DropTransaction(B256)
Removes transactions from the pool
DropAllTransactions()
Removes transactions from the pool
Reset(Option<Params<Option<Forking>>>)
Reset the fork to a fresh forked state, and optionally update the fork config
SetRpcUrl(String)
Sets the backend rpc url
SetBalance(Address, U256)
Modifies the balance of an account.
SetCode(Address, Bytes)
Sets the code of a contract
SetNonce(Address, U256)
Sets the nonce of an address
SetStorageAt(Address, U256, B256)
Writes a single slot of the account’s storage
SetCoinbase(Address)
Sets the coinbase address
SetChainId(u64)
Sets the chain id
SetLogging(bool)
Enable or disable logging
SetMinGasPrice(U256)
Set the minimum gas price for the node
SetNextBlockBaseFeePerGas(U256)
Sets the base fee of the next block
EvmSetTime(U256)
Sets the specific timestamp Accepts timestamp (Unix epoch) with millisecond precision and returns the number of seconds between the given timestamp and the current time.
DumpState(Option<Params<Option<bool>>>)
Serializes the current state (including contracts code, contract’s storage, accounts properties, etc.) into a saveable data blob
LoadState(Bytes)
Adds state previously dumped with DumpState
to the current chain
NodeInfo(())
Retrieves the Anvil node configuration params
AnvilMetadata(())
Retrieves the Anvil node metadata.
EvmSnapshot(())
Snapshot the state of the blockchain at the current block.
EvmRevert(U256)
Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to.
EvmIncreaseTime(U256)
Jump forward in time by the given amount of time, in seconds.
EvmSetNextBlockTimeStamp(U256)
Similar to evm_increaseTime
but takes the exact timestamp that you want in the next block
EvmSetBlockGasLimit(U256)
Set the exact gas limit that you want in the next block
EvmSetBlockTimeStampInterval(u64)
Similar to evm_increaseTime
but takes sets a block timestamp interval
.
The timestamp of the next block will be computed as lastBlock_timestamp + interval
.
EvmRemoveBlockTimeStampInterval(())
Removes a anvil_setBlockTimestampInterval
if it exists
EvmMine(Option<Params<Option<MineOptions>>>)
Mine a single block
EvmMineDetailed(Option<Params<Option<MineOptions>>>)
Mine a single block and return detailed data
This behaves exactly as EvmMine
but returns different output, for compatibility reasons
this is a separate call since evm_mine
is not an anvil original.
EthSendUnsignedTransaction(Box<WithOtherFields<TransactionRequest>>)
Execute a transaction regardless of signature status
EnableTraces(())
Turn on call traces for transactions that are returned to the user when they execute a transaction (instead of just txhash/receipt)
TxPoolStatus(())
Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_status
TxPoolInspect(())
Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_inspect
TxPoolContent(())
Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content
ErigonGetHeaderByNumber(BlockNumberOrTag)
Otterscan’s ots_getApiLevel
endpoint
Otterscan currently requires this endpoint, even though it’s not part of the ots_*
https://github.com/otterscan/otterscan/blob/071d8c55202badf01804f6f8d53ef9311d4a9e47/src/useProvider.ts#L71
Related upstream issue: https://github.com/otterscan/otterscan/issues/1081
OtsGetApiLevel(())
Otterscan’s ots_getApiLevel
endpoint
Used as a simple API versioning scheme for the ots_* namespace
OtsGetInternalOperations(B256)
Otterscan’s ots_getInternalOperations
endpoint
Traces internal ETH transfers, contracts creation (CREATE/CREATE2) and self-destructs for a
certain transaction.
OtsHasCode(Address, BlockNumberOrTag)
Otterscan’s ots_hasCode
endpoint
Check if an ETH address contains code at a certain block number.
OtsTraceTransaction(B256)
Otterscan’s ots_traceTransaction
endpoint
Trace a transaction and generate a trace call tree.
OtsGetTransactionError(B256)
Otterscan’s ots_getTransactionError
endpoint
Given a transaction hash, returns its raw revert reason.
OtsGetBlockDetails(BlockNumberOrTag)
Otterscan’s ots_getBlockDetails
endpoint
Given a block number, return its data. Similar to the standard eth_getBlockByNumber/Hash
method, but can be optimized by excluding unnecessary data such as transactions and
logBloom
OtsGetBlockDetailsByHash(B256)
Otterscan’s ots_getBlockDetails
endpoint
Same as ots_getBlockDetails
, but receiving a block hash instead of number
OtsGetBlockTransactions(u64, usize, usize)
Otterscan’s ots_getBlockTransactions
endpoint
Gets paginated transaction data for a certain block. Return data is similar to
eth_getBlockBy* + eth_getTransactionReceipt.
OtsSearchTransactionsBefore(Address, u64, usize)
Otterscan’s ots_searchTransactionsBefore
endpoint
Address history navigation. searches backwards from certain point in time.
OtsSearchTransactionsAfter(Address, u64, usize)
Otterscan’s ots_searchTransactionsAfter
endpoint
Address history navigation. searches forward from certain point in time.
OtsGetTransactionBySenderAndNonce(Address, U256)
Otterscan’s ots_getTransactionBySenderAndNonce
endpoint
Given a sender address and a nonce, returns the tx hash or null if not found. It returns
only the tx hash on success, you can use the standard eth_getTransactionByHash after that
to get the full transaction data.
OtsGetContractCreator(Address)
Otterscan’s ots_getTransactionBySenderAndNonce
endpoint
Given an ETH contract address, returns the tx hash and the direct address who created the
contract.
RemovePoolTransactions(Address)
Removes transactions from the pool by sender origin.
Reorg(ReorgOptions)
Reorg the chain
WalletGetCapabilities(())
Wallet
WalletSendTransaction(Box<WithOtherFields<TransactionRequest>>)
Wallet send_tx
AnvilAddCapability(Address)
Add an address to the DelegationCapability
of the wallet
AnvilSetExecutor(String)
Set the executor (sponsor) wallet
Trait Implementations§
Source§impl Clone for EthRequest
impl Clone for EthRequest
Source§fn clone(&self) -> EthRequest
fn clone(&self) -> EthRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EthRequest
impl Debug for EthRequest
Source§impl<'de> Deserialize<'de> for EthRequest
impl<'de> Deserialize<'de> for EthRequest
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>,
Auto Trait Implementations§
impl !Freeze for EthRequest
impl RefUnwindSafe for EthRequest
impl Send for EthRequest
impl Sync for EthRequest
impl Unpin for EthRequest
impl UnwindSafe for EthRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Conv for T
impl<T> Conv for T
§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§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>
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> Pointable for T
impl<T> Pointable for T
§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.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
impl<T> RpcReturn for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 976 bytes
Size for each variant:
Web3ClientVersion
: 0 bytesWeb3Sha3
: 48 bytesEthChainId
: 0 bytesEthNetworkId
: 0 bytesNetListening
: 0 bytesEthGasPrice
: 0 bytesEthMaxPriorityFeePerGas
: 0 bytesEthBlobBaseFee
: 0 bytesEthAccounts
: 0 bytesEthBlockNumber
: 0 bytesEthGetBalance
: 80 bytesEthGetAccount
: 80 bytesEthGetStorageAt
: 112 bytesEthGetBlockByHash
: 49 bytesEthGetBlockByNumber
: 40 bytesEthGetTransactionCount
: 80 bytesEthGetTransactionCountByHash
: 48 bytesEthGetTransactionCountByNumber
: 32 bytesEthGetUnclesCountByHash
: 48 bytesEthGetUnclesCountByNumber
: 32 bytesEthGetCodeAt
: 80 bytesEthGetProof
: 104 bytesEthSign
: 72 bytesPersonalSign
: 72 bytesEthSignTransaction
: 24 bytesEthSignTypedData
: 112 bytesEthSignTypedDataV3
: 112 bytesEthSignTypedDataV4
: 328 bytesEthSendTransaction
: 24 bytesEthSendRawTransaction
: 48 bytesEthCall
: 608 bytesEthCreateAccessList
: 576 bytesEthEstimateGas
: 608 bytesEthGetTransactionByHash
: 48 bytesEthGetTransactionByBlockHashAndIndex
: 56 bytesEthGetTransactionByBlockNumberAndIndex
: 40 bytesEthGetRawTransactionByHash
: 48 bytesEthGetRawTransactionByBlockHashAndIndex
: 56 bytesEthGetRawTransactionByBlockNumberAndIndex
: 40 bytesEthGetTransactionReceipt
: 48 bytesEthGetBlockReceipts
: 56 bytesEthGetUncleByBlockHashAndIndex
: 56 bytesEthGetUncleByBlockNumberAndIndex
: 40 bytesEthGetLogs
: 256 bytesEthNewFilter
: 256 bytesEthGetFilterChanges
: 40 bytesEthNewBlockFilter
: 0 bytesEthNewPendingTransactionFilter
: 0 bytesEthGetFilterLogs
: 40 bytesEthUninstallFilter
: 40 bytesEthGetWork
: 0 bytesEthSubmitWork
: 88 bytesEthSubmitHashRate
: 80 bytesEthFeeHistory
: 88 bytesEthSyncing
: 0 bytesDebugGetRawTransaction
: 48 bytesDebugTraceTransaction
: 192 bytesDebugTraceCall
: 976 bytesTraceTransaction
: 48 bytesTraceBlock
: 32 bytesTraceFilter
: 136 bytesImpersonateAccount
: 36 bytesStopImpersonatingAccount
: 36 bytesAutoImpersonateAccount
: 17 bytesGetAutoMine
: 0 bytesMine
: 96 bytesSetAutomine
: 17 bytesSetIntervalMining
: 24 bytesGetIntervalMining
: 0 bytesDropTransaction
: 48 bytesDropAllTransactions
: 0 bytesReset
: 56 bytesSetRpcUrl
: 40 bytesSetBalance
: 72 bytesSetCode
: 72 bytesSetNonce
: 72 bytesSetStorageAt
: 104 bytesSetCoinbase
: 36 bytesSetChainId
: 24 bytesSetLogging
: 17 bytesSetMinGasPrice
: 48 bytesSetNextBlockBaseFeePerGas
: 48 bytesEvmSetTime
: 48 bytesDumpState
: 17 bytesLoadState
: 48 bytesNodeInfo
: 0 bytesAnvilMetadata
: 0 bytesEvmSnapshot
: 0 bytesEvmRevert
: 48 bytesEvmIncreaseTime
: 48 bytesEvmSetNextBlockTimeStamp
: 48 bytesEvmSetBlockGasLimit
: 48 bytesEvmSetBlockTimeStampInterval
: 24 bytesEvmRemoveBlockTimeStampInterval
: 0 bytesEvmMine
: 48 bytesEvmMineDetailed
: 48 bytesEthSendUnsignedTransaction
: 24 bytesEnableTraces
: 0 bytesTxPoolStatus
: 0 bytesTxPoolInspect
: 0 bytesTxPoolContent
: 0 bytesErigonGetHeaderByNumber
: 32 bytesOtsGetApiLevel
: 0 bytesOtsGetInternalOperations
: 48 bytesOtsHasCode
: 56 bytesOtsTraceTransaction
: 48 bytesOtsGetTransactionError
: 48 bytesOtsGetBlockDetails
: 32 bytesOtsGetBlockDetailsByHash
: 48 bytesOtsGetBlockTransactions
: 40 bytesOtsSearchTransactionsBefore
: 56 bytesOtsSearchTransactionsAfter
: 56 bytesOtsGetTransactionBySenderAndNonce
: 72 bytesOtsGetContractCreator
: 36 bytesRemovePoolTransactions
: 36 bytesReorg
: 48 bytesWalletGetCapabilities
: 0 bytesWalletSendTransaction
: 24 bytesAnvilAddCapability
: 36 bytesAnvilSetExecutor
: 40 bytes