pub struct Operator<C: CitreaClientT> {
pub rpc: ExtendedBitcoinRpc,
pub db: Database,
pub signer: Actor,
pub config: BridgeConfig,
pub collateral_funding_outpoint: OutPoint,
pub(crate) reimburse_addr: Address,
pub tx_sender: TxSenderClient,
pub header_chain_prover: HeaderChainProver,
pub citrea_client: C,
}
Fields§
§rpc: ExtendedBitcoinRpc
§db: Database
§signer: Actor
§config: BridgeConfig
§collateral_funding_outpoint: OutPoint
§reimburse_addr: Address
§tx_sender: TxSenderClient
§header_chain_prover: HeaderChainProver
§citrea_client: C
Implementations§
Source§impl<C> Operator<C>where
C: CitreaClientT,
impl<C> Operator<C>where
C: CitreaClientT,
Sourcepub async fn create_assert_commitment_txs(
&self,
assert_data: TransactionRequestData,
commit_data: Vec<Vec<Vec<u8>>>,
dbtx: Option<DatabaseTransaction<'_, '_>>,
) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
pub async fn create_assert_commitment_txs( &self, assert_data: TransactionRequestData, commit_data: Vec<Vec<Vec<u8>>>, dbtx: Option<DatabaseTransaction<'_, '_>>, ) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
Creates and signs all the assert commitment transactions for a single kickoff of an operator.
§Arguments
assert_data
- Data to identify the deposit and kickoff.commit_data
- BitVM assertions for the kickoff, for each assert tx.
§Returns
A vector of tuples: 1. TransactionType: MiniAssert(idx) for idx’th assert commitment 2. Transaction: Signed assert commitment transaction
Sourcepub async fn create_latest_blockhash_tx(
&self,
assert_data: TransactionRequestData,
block_hash: BlockHash,
dbtx: Option<DatabaseTransaction<'_, '_>>,
) -> Result<(TransactionType, Transaction), BridgeError>
pub async fn create_latest_blockhash_tx( &self, assert_data: TransactionRequestData, block_hash: BlockHash, dbtx: Option<DatabaseTransaction<'_, '_>>, ) -> Result<(TransactionType, Transaction), BridgeError>
Creates and signs the latest blockhash transaction for a single kickoff of an operator.
§Arguments
assert_data
- Data to identify the deposit and kickoff.block_hash
- Block hash to commit using winternitz signatures.
§Returns
A tuple of: 1. TransactionType: LatestBlockhash 2. Transaction: Signed latest blockhash transaction
Source§impl<C> Operator<C>where
C: CitreaClientT,
impl<C> Operator<C>where
C: CitreaClientT,
Sourcepub async fn new(config: BridgeConfig) -> Result<Self, BridgeError>
pub async fn new(config: BridgeConfig) -> Result<Self, BridgeError>
Creates a new Operator
.
pub async fn send_initial_round_tx( &self, round_tx: &Transaction, ) -> Result<(), BridgeError>
Sourcepub async fn get_params(
&self,
) -> Result<(Receiver<PublicKey>, Receiver<Signature>), BridgeError>
pub async fn get_params( &self, ) -> Result<(Receiver<PublicKey>, Receiver<Signature>), BridgeError>
Returns an operator’s winternitz public keys and challenge ackpreimages & hashes.
§Returns
- [
mpsc::Receiver
]: A [tokio
] data channel with a type of [winternitz::PublicKey
] and size of operator’s winternitz public keys count - [
mpsc::Receiver
]: A [tokio
] data channel with a type ofPublicHash
and size of operator’s challenge ack preimages & hashes count
pub async fn deposit_sign( &self, deposit_data: DepositData, ) -> Result<Receiver<Signature>, BridgeError>
Sourcepub async fn track_rounds(&self) -> Result<(), BridgeError>
pub async fn track_rounds(&self) -> Result<(), BridgeError>
Creates the round state machine by adding a system event to the database
Sourcefn is_profitable(
input_amount: Amount,
withdrawal_amount: Amount,
bridge_amount_sats: Amount,
operator_withdrawal_fee_sats: Amount,
) -> bool
fn is_profitable( input_amount: Amount, withdrawal_amount: Amount, bridge_amount_sats: Amount, operator_withdrawal_fee_sats: Amount, ) -> bool
Checks if the withdrawal amount is within the acceptable range.
Sourcepub async fn withdraw(
&self,
withdrawal_index: u32,
in_signature: Signature,
in_outpoint: OutPoint,
out_script_pubkey: ScriptBuf,
out_amount: Amount,
) -> Result<Transaction, BridgeError>
pub async fn withdraw( &self, withdrawal_index: u32, in_signature: Signature, in_outpoint: OutPoint, out_script_pubkey: ScriptBuf, out_amount: Amount, ) -> Result<Transaction, BridgeError>
Prepares a withdrawal by:
- Checking if the withdrawal has been made on Citrea
- Verifying the given signature
- Checking if the withdrawal is profitable or not
- Funding the withdrawal transaction using TxSender RBF option
§Parameters
withdrawal_idx
: Citrea withdrawal UTXO indexin_signature
: User’s signature that is going to be used for signing withdrawal transaction inputin_outpoint
: User’s input for the payout transactionout_script_pubkey
: User’s script pubkey which will be used in the payout transaction’s outputout_amount
: Payout transaction output’s value
§Returns
- Ok(()) if the withdrawal checks are successful and a payout transaction is added to the TxSender
- Err(BridgeError) if the withdrawal checks fail
Sourcepub fn generate_assert_winternitz_pubkeys(
&self,
deposit_outpoint: OutPoint,
) -> Result<Vec<PublicKey>, BridgeError>
pub fn generate_assert_winternitz_pubkeys( &self, deposit_outpoint: OutPoint, ) -> Result<Vec<PublicKey>, BridgeError>
Generates Winternitz public keys for every BitVM assert tx for a deposit.
§Returns
Vec<Vec<winternitz::PublicKey>>
: Winternitz public keys forwatchtower index
row andBitVM assert tx index
column.
Sourcepub fn generate_kickoff_winternitz_pubkeys(
&self,
) -> Result<Vec<PublicKey>, BridgeError>
pub fn generate_kickoff_winternitz_pubkeys( &self, ) -> Result<Vec<PublicKey>, BridgeError>
Generates Winternitz public keys for every blockhash commit to be used in kickoff utxos. Unique for each kickoff utxo of operator.
§Returns
Vec<Vec<winternitz::PublicKey>>
: Winternitz public keys forround_index
row andkickoff_idx
column.
pub fn generate_unspent_kickoff_sigs( &self, kickoff_wpks: &KickoffWinternitzKeys, ) -> Result<Vec<Signature>, BridgeError>
pub fn generate_challenge_ack_preimages_and_hashes( &self, deposit_data: &DepositData, ) -> Result<Vec<PublicHash>, BridgeError>
pub async fn handle_finalized_payout<'a>( &'a self, dbtx: DatabaseTransaction<'a, '_>, deposit_outpoint: OutPoint, payout_tx_blockhash: BlockHash, ) -> Result<Txid, BridgeError>
async fn start_first_round( &self, dbtx: DatabaseTransaction<'_, '_>, kickoff_wpks: KickoffWinternitzKeys, ) -> Result<(), BridgeError>
pub async fn end_round<'a>( &'a self, dbtx: DatabaseTransaction<'a, '_>, ) -> Result<(), BridgeError>
async fn send_asserts( &self, kickoff_data: KickoffData, deposit_data: DepositData, watchtower_challenges: HashMap<usize, Transaction>, _payout_blockhash: Witness, latest_blockhash: Witness, ) -> Result<(), BridgeError>
fn data(&self) -> OperatorData
async fn send_latest_blockhash( &self, kickoff_data: KickoffData, deposit_data: DepositData, latest_blockhash: BlockHash, ) -> Result<(), BridgeError>
Sourceasync fn validate_payer_is_operator(
&self,
dbtx: Option<DatabaseTransaction<'_, '_>>,
deposit_id: u32,
) -> Result<(BlockHash, Txid), BridgeError>
async fn validate_payer_is_operator( &self, dbtx: Option<DatabaseTransaction<'_, '_>>, deposit_id: u32, ) -> Result<(BlockHash, Txid), BridgeError>
For a deposit_id checks that the payer for that deposit is the operator, and the payout blockhash and kickoff txid are set.
async fn get_next_txs_to_send( &self, dbtx: Option<DatabaseTransaction<'_, '_>>, deposit_data: &mut DepositData, payout_blockhash: BlockHash, kickoff_txid: Txid, current_round_idx: RoundIndex, ) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
Sourcepub async fn get_reimbursement_txs(
&self,
deposit_outpoint: OutPoint,
) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
pub async fn get_reimbursement_txs( &self, deposit_outpoint: OutPoint, ) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
For a given deposit outpoint, get the txs that are needed to reimburse the deposit. To avoid operator getting slashed, this function only returns the next tx that needs to be sent This fn can track and enable sending of these transactions during a normal reimbursement process.
- First, if the current round is less than the round of the kickoff assigned to the deposit by PayoutCheckerTask, it returns the Round TX.
- After Round tx is sent, it returns the Kickoff tx.
- After Kickoff tx is sent, it returns the challenge timeout tx.
- After challenge timeout tx is sent, it returns BurnUnusedKickoffConnectors tx. If challenge timeout tx is not sent, and but challenge utxo was spent, it means the kickoff was challenged, thus the fn returns an error as it cannot handle the challenge process. Automation is required to answer the challenge.
- After all kickoff utxos are spent, and for any live kickoff, all kickoff finalizers are spent, it returns the ReadyToReimburse tx.
- After ReadyToReimburse tx is sent, it returns the next Round tx to generate reimbursement utxos.
- Finally, after the next round tx is sent, it returns the Reimburse tx.
Sourceasync fn advance_round_manually(
&self,
dbtx: Option<DatabaseTransaction<'_, '_>>,
round_idx: RoundIndex,
) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
async fn advance_round_manually( &self, dbtx: Option<DatabaseTransaction<'_, '_>>, round_idx: RoundIndex, ) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
Checks the current round status, and returns the next txs that are safe to send to be able to advance to the next round.
Sourceasync fn find_and_mark_unspent_kickoff_utxos(
&self,
dbtx: Option<DatabaseTransaction<'_, '_>>,
round_idx: RoundIndex,
round_txid: Txid,
current_chain_height: u32,
) -> Result<(Vec<usize>, bool), BridgeError>
async fn find_and_mark_unspent_kickoff_utxos( &self, dbtx: Option<DatabaseTransaction<'_, '_>>, round_idx: RoundIndex, round_txid: Txid, current_chain_height: u32, ) -> Result<(Vec<usize>, bool), BridgeError>
Finds unspent kickoff UTXOs and marks spent ones as used in the database. Returns the unspent kickoff utxos (doesn’t matter if finalized or unfinalized) and a boolean to mark if all utxos are spent and finalized
Sourceasync fn create_burn_unused_kickoff_connectors_tx(
&self,
round_idx: RoundIndex,
unspent_kickoff_utxos: &[usize],
) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
async fn create_burn_unused_kickoff_connectors_tx( &self, round_idx: RoundIndex, unspent_kickoff_utxos: &[usize], ) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
Creates a transaction that burns unused kickoff connectors.
Sourceasync fn validate_all_kickoff_finalizers_spent(
&self,
dbtx: Option<DatabaseTransaction<'_, '_>>,
round_idx: RoundIndex,
current_chain_height: u32,
) -> Result<(), BridgeError>
async fn validate_all_kickoff_finalizers_spent( &self, dbtx: Option<DatabaseTransaction<'_, '_>>, round_idx: RoundIndex, current_chain_height: u32, ) -> Result<(), BridgeError>
Validates that all kickoff finalizers are spent for the given round.
Sourceasync fn send_next_round_tx(
&self,
dbtx: Option<DatabaseTransaction<'_, '_>>,
round_idx: RoundIndex,
) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
async fn send_next_round_tx( &self, dbtx: Option<DatabaseTransaction<'_, '_>>, round_idx: RoundIndex, ) -> Result<Vec<(TransactionType, Transaction)>, BridgeError>
Checks if the next round tx is on chain, if it is, updates the database, otherwise returns the round tx that needs to be sent.
Trait Implementations§
Source§impl<C> From<Operator<C>> for OperatorParamswhere
C: CitreaClientT,
impl<C> From<Operator<C>> for OperatorParamswhere
C: CitreaClientT,
Source§impl<C> NamedEntity for Operator<C>where
C: CitreaClientT,
impl<C> NamedEntity for Operator<C>where
C: CitreaClientT,
Source§const ENTITY_NAME: &'static str = "operator"
const ENTITY_NAME: &'static str = "operator"
Source§const TX_SENDER_CONSUMER_ID: &'static str = "verifier_tx_sender"
const TX_SENDER_CONSUMER_ID: &'static str = "verifier_tx_sender"
Source§const FINALIZED_BLOCK_CONSUMER_ID_AUTOMATION: &'static str = "operator_finalized_block_fetcher_automation"
const FINALIZED_BLOCK_CONSUMER_ID_AUTOMATION: &'static str = "operator_finalized_block_fetcher_automation"
Source§const FINALIZED_BLOCK_CONSUMER_ID_NO_AUTOMATION: &'static str = "operator_finalized_block_fetcher_no_automation"
const FINALIZED_BLOCK_CONSUMER_ID_NO_AUTOMATION: &'static str = "operator_finalized_block_fetcher_no_automation"
Source§impl<C> Owner for Operator<C>where
C: CitreaClientT,
impl<C> Owner for Operator<C>where
C: CitreaClientT,
Source§fn handle_duty<'life0, 'async_trait>(
&'life0 self,
duty: Duty,
) -> Pin<Box<dyn Future<Output = Result<DutyResult, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_duty<'life0, 'async_trait>(
&'life0 self,
duty: Duty,
) -> Pin<Box<dyn Future<Output = Result<DutyResult, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn create_txhandlers<'life0, 'async_trait>(
&'life0 self,
tx_type: TransactionType,
contract_context: ContractContext,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<TransactionType, TxHandler>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_txhandlers<'life0, 'async_trait>(
&'life0 self,
tx_type: TransactionType,
contract_context: ContractContext,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<TransactionType, TxHandler>, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn handle_finalized_block<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_dbtx: DatabaseTransaction<'life1, 'life2>,
_block_id: u32,
_block_height: u32,
_block_cache: Arc<BlockCache>,
_light_client_proof_wait_interval_secs: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_finalized_block<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_dbtx: DatabaseTransaction<'life1, 'life2>,
_block_id: u32,
_block_height: u32,
_block_cache: Arc<BlockCache>,
_light_client_proof_wait_interval_secs: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl<C> Freeze for Operator<C>where
C: Freeze,
impl<C> !RefUnwindSafe for Operator<C>
impl<C> Send for Operator<C>
impl<C> Sync for Operator<C>
impl<C> Unpin for Operator<C>where
C: Unpin,
impl<C> !UnwindSafe for Operator<C>
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> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
fn exact_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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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
Source§impl<T> L1SyncStatusProvider for T
impl<T> L1SyncStatusProvider for T
fn get_l1_status<'life0, 'life1, 'async_trait>(
db: &'life0 Database,
rpc: &'life1 ExtendedBitcoinRpc,
) -> Pin<Box<dyn Future<Output = Result<L1SyncStatus, BridgeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
§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> 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, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
impl<T, U> RoundingInto<U> for Twhere
U: RoundingFrom<T>,
fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)
§impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
impl<T, U> SaturatingInto<U> for Twhere
U: SaturatingFrom<T>,
fn saturating_into(self) -> U
§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.