pub struct ApiServer {Show 13 fields
eth_rpc_client: Client,
req_receiver: Receiver<ApiRequest>,
backend: BackendWithOverlay,
logging_manager: LoggingManager,
client: Arc<Client>,
mining_engine: Arc<MiningEngine>,
wallet: DevSigner,
block_provider: SubxtBlockInfoProvider,
revert_manager: RevertManager,
impersonation_manager: ImpersonationManager,
tx_pool: Arc<TransactionPoolHandle>,
instance_id: B256,
filters: Filters,
}Fields§
§eth_rpc_client: Client§req_receiver: Receiver<ApiRequest>§backend: BackendWithOverlay§logging_manager: LoggingManager§client: Arc<Client>§mining_engine: Arc<MiningEngine>§wallet: DevSigner§block_provider: SubxtBlockInfoProvider§revert_manager: RevertManager§impersonation_manager: ImpersonationManager§tx_pool: Arc<TransactionPoolHandle>§instance_id: B256§filters: FiltersTracks all active filters
Implementations§
Source§impl ApiServer
impl ApiServer
pub async fn new( substrate_service: Service, req_receiver: Receiver<ApiRequest>, logging_manager: LoggingManager, revert_manager: RevertManager, impersonation_manager: ImpersonationManager, signers: Vec<Keypair>, filters: Filters, revive_rpc_block_limit: Option<usize>, ) -> Result<Self>
pub async fn run(self)
pub async fn execute(&mut self, req: EthRequest) -> ResponseResult
fn set_logging(&self, enabled: bool) -> Result<()>
async fn mine(&self, blocks: Option<U256>, interval: Option<U256>) -> Result<()>
fn set_interval_mining(&self, interval: u64) -> Result<()>
fn get_interval_mining(&self) -> Result<Option<u64>>
fn get_auto_mine(&self) -> Result<bool>
fn set_auto_mine(&self, enabled: bool) -> Result<()>
async fn evm_mine( &self, mine: Option<AnvilCoreParams<Option<MineOptions>>>, ) -> Result<String>
async fn evm_mine_detailed( &self, mine: Option<AnvilCoreParams<Option<MineOptions>>>, ) -> Result<Vec<Block>>
fn set_block_timestamp_interval(&self, time: u64) -> Result<()>
fn remove_block_timestamp_interval(&self) -> Result<bool>
fn set_next_block_timestamp(&self, time: U256) -> Result<()>
fn increase_time(&self, time: U256) -> Result<i64>
fn set_time(&self, timestamp: U256) -> Result<u64>
fn impersonate_account(&mut self, addr: H160) -> Result<()>
fn auto_impersonate_account(&mut self, enable: bool) -> Result<()>
fn stop_impersonating_account(&mut self, addr: &H160) -> Result<()>
fn chain_id(&self, at: Hash) -> u64
fn eth_chain_id(&self) -> Result<U64>
fn network_id(&self) -> Result<u64>
fn net_listening(&self) -> Result<bool>
fn syncing(&self) -> Result<bool>
async fn transaction_receipt( &self, tx_hash: B256, ) -> Result<Option<ReceiptInfo>>
async fn get_balance( &self, addr: Address, block: Option<BlockId>, ) -> Result<U256>
async fn get_storage_at( &self, addr: Address, slot: U256, block: Option<BlockId>, ) -> Result<B256>
async fn get_code( &self, address: Address, block: Option<BlockId>, ) -> Result<Bytes>
Sourceasync fn get_block_by_hash(
&self,
block_hash: B256,
hydrated_transactions: bool,
) -> Result<Option<Block>>
async fn get_block_by_hash( &self, block_hash: B256, hydrated_transactions: bool, ) -> Result<Option<Block>>
Returns the EVM block with the given ethereum hash.
async fn estimate_gas( &self, request: WithOtherFields<TransactionRequest>, block: Option<BlockId>, ) -> Result<U256>
async fn call( &self, request: WithOtherFields<TransactionRequest>, block: Option<BlockId>, ) -> Result<Bytes>
async fn gas_price(&self) -> Result<U256>
async fn get_transaction_count( &self, address: H160, block: Option<BlockId>, ) -> Result<U256>
async fn send_raw_transaction(&self, transaction: Bytes) -> Result<H256>
pub async fn send_raw_transaction_sync(&self, tx: Bytes) -> Result<ReceiptInfo>
async fn send_transaction( &self, transaction_req: WithOtherFields<TransactionRequest>, unsigned_tx: bool, ) -> Result<H256>
async fn send_transaction_sync( &self, request: WithOtherFields<TransactionRequest>, ) -> Result<ReceiptInfo>
async fn get_block_by_number( &self, block_number: BlockNumberOrTag, hydrated_transactions: bool, ) -> Result<Option<Block>>
pub(crate) async fn snapshot(&mut self) -> Result<U256>
pub(crate) async fn revert(&mut self, id: U256) -> Result<bool>
Sourcepub(crate) async fn reset(&mut self, forking: Option<Forking>) -> Result<()>
pub(crate) async fn reset(&mut self, forking: Option<Forking>) -> Result<()>
Reset to genesis if no forking information is set.
TODO: currently the forking information is not consider at the RPC level, but it will need to be considered once forking feature is functional.
pub(crate) async fn rollback(&mut self, depth: Option<u64>) -> Result<()>
async fn anvil_node_info(&self) -> Result<NodeInfo>
async fn anvil_metadata(&self) -> Result<AnvilMetadata>
async fn get_block_transaction_count_by_hash( &self, block_hash: B256, ) -> Result<Option<U256>>
async fn get_block_transaction_count_by_number( &self, block_number: BlockNumberOrTag, ) -> Result<Option<U256>>
async fn get_transaction_by_block_hash_and_index( &self, block_hash: B256, transaction_index: U256, ) -> Result<Option<TransactionInfo>>
async fn get_transaction_by_block_number_and_index( &self, block: BlockNumberOrTag, transaction_index: U256, ) -> Result<Option<TransactionInfo>>
async fn get_transaction_by_hash( &self, transaction_hash: B256, ) -> Result<Option<TransactionInfo>>
async fn fee_history( &self, block_count: U256, newest_block: BlockNumberOrTag, reward_percentiles: Option<Vec<f64>>, ) -> Result<FeeHistoryResult>
async fn max_priority_fee_per_gas(&self) -> Result<U256>
pub fn accounts(&self) -> Result<Vec<H160>>
async fn get_logs(&self, filter: Filter) -> Result<FilterResults>
fn set_chain_id(&self, chain_id: u64) -> Result<()>
fn set_balance(&self, address: Address, value: U256) -> Result<()>
fn set_nonce(&self, address: Address, value: U256) -> Result<()>
fn set_storage_at(&self, address: Address, key: U256, value: B256) -> Result<()>
fn set_code(&self, address: Address, bytes: Bytes) -> Result<()>
fn set_immutable_storage_at( &self, address: Address, immutables: Vec<Bytes>, ) -> Result<()>
async fn sign( &self, address: Address, content: impl AsRef<[u8]>, ) -> Result<String>
fn sign_typed_data(&self, _address: Address, _data: Value) -> Result<String>
fn sign_typed_data_v3(&self, _address: Address, _data: Value) -> Result<String>
async fn sign_transaction( &self, tx: WithOtherFields<TransactionRequest>, ) -> Result<TransactionSigned>
async fn sign_typed_data_v4( &self, address: Address, data: TypedData, ) -> Result<String>
async fn get_account( &self, address: Address, block_number: Option<BlockId>, ) -> Result<TrieAccount>
async fn get_account_info( &self, address: Address, block_number: Option<BlockId>, ) -> Result<AccountInfo>
Sourceasync fn new_block_filter(&self) -> Result<String>
async fn new_block_filter(&self) -> Result<String>
Creates a filter to notify about new blocks
Sourceasync fn uninstall_filter(&self, id: &str) -> Result<bool>
async fn uninstall_filter(&self, id: &str) -> Result<bool>
Remove filter
Sourceasync fn get_filter_changes(&self, id: &str) -> ResponseResult
async fn get_filter_changes(&self, id: &str) -> ResponseResult
Polls a filter and returns all events that happened since the last poll.
async fn new_pending_transactions_filter(&self) -> Result<String>
async fn new_filter(&self, filter: Filter) -> Result<String>
async fn get_filter_logs(&self, id: &str) -> Result<Vec<Log>>
async fn update_block_provider_on_revert( &self, info: &Info<OpaqueBlock>, ) -> Result<()>
async fn update_time_on_revert(&self, best_hash: Hash) -> Result<()>
async fn on_revert_update(&self, revert_info: RevertInfo) -> Result<()>
async fn maybe_get_block_hash_for_tag( &self, block_id: Option<BlockId>, ) -> Result<Option<H256>>
Sourceasync fn get_block_hash_for_tag(
&self,
block_id: Option<BlockId>,
) -> Result<H256>
async fn get_block_hash_for_tag( &self, block_id: Option<BlockId>, ) -> Result<H256>
Returns the substrate block hash for a given block id.
fn get_account_id(&self, block: Hash, address: Address) -> Result<AccountId>
fn construct_balance_with_dust( &self, block: Hash, value: U256, ) -> Result<(Balance, u32)>
fn latest_block(&self) -> H256
Sourceasync fn get_block_by_substrate_hash(
&self,
block_hash: H256,
) -> Result<Option<Block>>
async fn get_block_by_substrate_hash( &self, block_hash: H256, ) -> Result<Option<Block>>
Returns the EVM block for a given substrate block hash.
fn set_frame_system_balance( &self, latest_block: H256, account_id: AccountId, balance: Balance, ) -> Result<()>
Sourceasync fn txpool_status(&self) -> Result<TxpoolStatus>
async fn txpool_status(&self) -> Result<TxpoolStatus>
Returns transaction pool status
Sourceasync fn txpool_inspect(&self) -> Result<TxpoolInspect>
async fn txpool_inspect(&self) -> Result<TxpoolInspect>
Returns a summary of all transactions in the pool
Sourceasync fn txpool_content(&self) -> Result<TxpoolContent<TxpoolTransactionInfo>>
async fn txpool_content(&self) -> Result<TxpoolContent<TxpoolTransactionInfo>>
Returns full transaction details for all transactions in the pool
Sourceasync fn anvil_drop_all_transactions(&self) -> Result<()>
async fn anvil_drop_all_transactions(&self) -> Result<()>
Drop all transactions from pool
Sourceasync fn anvil_drop_transaction(&self, eth_hash: B256) -> Result<Option<B256>>
async fn anvil_drop_transaction(&self, eth_hash: B256) -> Result<Option<B256>>
Drop a specific transaction from the pool by its ETH hash
Sourceasync fn anvil_remove_pool_transactions(&self, address: Address) -> Result<()>
async fn anvil_remove_pool_transactions(&self, address: Address) -> Result<()>
Remove all transactions from a specific sender address
async fn debug_trace_transaction( &self, tx_hash: B256, geth_tracer_options: GethDebugTracingOptions, ) -> Result<GethTrace>
async fn debug_trace_call( &self, request: WithOtherFields<TransactionRequest>, block_number: Option<BlockId>, geth_tracer_options: GethDebugTracingCallOptions, ) -> Result<GethTrace>
async fn debug_trace_block_by_number( &self, block_number: BlockNumberOrTag, geth_tracer_options: GethDebugTracingOptions, ) -> Result<Vec<TraceResult>>
async fn trace_transaction( &self, tx_hash: B256, ) -> Result<Vec<LocalizedTransactionTrace>>
async fn trace_block( &self, block_number: BlockNumberOrTag, ) -> Result<Vec<LocalizedTransactionTrace>>
async fn wait_for_receipt( &self, hash: B256, receiver: Receiver<H256>, ) -> Result<ReceiptInfo>
async fn wait_for_hash( &self, receiver: Option<Receiver<H256>>, awaited_hash: H256, ) -> Result<()>
fn new_block_notifications(&self) -> Result<Receiver<H256>>
async fn log_mined_block(&self, block_hash: H256) -> Result<()>
Auto Trait Implementations§
impl Freeze for ApiServer
impl !RefUnwindSafe for ApiServer
impl Send for ApiServer
impl Sync for ApiServer
impl Unpin for ApiServer
impl !UnwindSafe for ApiServer
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§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, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
§fn defensive_truncate_into(self) -> U
fn defensive_truncate_into(self) -> U
§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<TxEnv, T> FromRecoveredTx<&T> for TxEnvwhere
TxEnv: FromRecoveredTx<T>,
impl<TxEnv, T> FromRecoveredTx<&T> for TxEnvwhere
TxEnv: FromRecoveredTx<T>,
§fn from_recovered_tx(tx: &&T, sender: Address) -> TxEnv
fn from_recovered_tx(tx: &&T, sender: Address) -> TxEnv
TxEnv] from a transaction and a sender address.§impl<TxEnv, T> FromTxWithEncoded<&T> for TxEnvwhere
TxEnv: FromTxWithEncoded<T>,
impl<TxEnv, T> FromTxWithEncoded<&T> for TxEnvwhere
TxEnv: FromTxWithEncoded<T>,
§fn from_encoded_tx(tx: &&T, sender: Address, encoded: Bytes) -> TxEnv
fn from_encoded_tx(tx: &&T, sender: Address, encoded: Bytes) -> TxEnv
TxEnv] from a transaction, its sender, and encoded transaction bytes.§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.§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, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
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>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§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>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> JsonSchemaMaybe for T
impl<T> MaybeSend for Twhere
T: Send,
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: 656 bytes