pub struct KickoffStateMachine<T: Owner> {
pub(crate) matchers: HashMap<Matcher, KickoffEvent>,
pub(crate) dirty: bool,
pub(crate) kickoff_data: KickoffData,
pub(crate) deposit_data: DepositData,
pub(crate) kickoff_height: u32,
pub(crate) payout_blockhash: Witness,
spent_watchtower_utxos: HashSet<usize>,
latest_blockhash: Witness,
watchtower_challenges: HashMap<usize, Transaction>,
operator_asserts: HashMap<usize, Witness>,
operator_challenge_acks: HashMap<usize, Witness>,
phantom: PhantomData<T>,
}
Expand description
State machine for tracking a single kickoff process in the protocol.
§Purpose
The KickoffStateMachine
manages the lifecycle of a single kickoff process, which is created after a kickoff transaction is detected on Bitcoin. It tracks the transactions related to the kickoff and the resulting data.
§States
kickoff_started
: The initial state after a kickoff is detected. Waits for further events such as challenges, but still tracks any committed data on Bitcoin (like latest blockhash, operator asserts, watchtower challenges, etc)challenged
: Entered if the kickoff is challenged. Watchtower challenges are only sent if the kickoff is challenged.closed
: Terminal state indicating the kickoff process has ended, either by kickoff finalizer utxo or burn connector utxo being spent.
§Events
Challenged
: The kickoff is challenged, transitioning to thechallenged
state.WatchtowerChallengeSent
: A watchtower challenge is detected on Bitcoin, stores the watchtower challenge transaction, and stores the watchtower utxo as spent.OperatorAssertSent
: An operator BitVM assert is detected, stores the witness of the assert utxo.WatchtowerChallengeTimeoutSent
: A watchtower challenge timeout is detected, stores watchtower utxo as spent.OperatorChallengeAckSent
: An operator challenge acknowledgment is detected, stores the witness of the challenge ack utxo, which holds the revealed preimage that can be used to disprove if the operator maliciously doesn’t include the watchtower challenge in the BitVM proof. After sending this transaction, the operator is forced to use the corresponding watchtower challenge in its BitVM proof, otherwise it can be disproven.LatestBlockHashSent
: The latest blockhash is committed on Bitcoin, stores the witness of the latest blockhash utxo, which holds the blockhash that should be used by the operator in its BitVM proof.KickoffFinalizerSpent
: The kickoff finalizer is spent, ending the kickoff process, transitions to theclosed
state.BurnConnectorSpent
: The burn connector is spent, ending the kickoff process, transitions to theclosed
state.TimeToSendWatchtowerChallenge
: Time to send a watchtower challenge (used in challenged state), this event notifies the owner to create and send a watchtower challenge tx. Verifiers wait after a kickoff to send a watchtower challenge so that the total work in the watchtower challenge is as high as possible.SavedToDb
: Indicates the state machine has been persisted and resets the dirty flag.
§Behavior
- The state machine maintains a set of matchers to detect relevant Bitcoin transactions and trigger corresponding events.
- It tracks the progress of the kickoff, including challenges, operator actions, and finalization.
- When terminal events occur (e.g., finalizer or burn connector spent), the state machine transitions to
closed
and clears all matchers. - The state machine interacts with the owner to perform protocol duties (e.g., sending challenges, asserts, or disproves) as required by the protocol logic.
This design ensures that all protocol-critical events related to a kickoff are tracked and handled in a robust, stateful manner, supporting both normal and adversarial scenarios.
Fields§
§matchers: HashMap<Matcher, KickoffEvent>
Maps matchers to the resulting kickoff events.
dirty: bool
Indicates if the state machine has unsaved changes that need to be persisted on db. dirty flag is set if any matcher matches the current block. the flag is set to true in on_transition and on_dispatch the flag is set to false after the state machine is saved to db and the event SavedToDb is dispatched
kickoff_data: KickoffData
The kickoff data associated with the kickoff being tracked.
deposit_data: DepositData
The deposit data that the kickoff tries to withdraw from.
kickoff_height: u32
The block height at which the kickoff transaction was mined.
payout_blockhash: Witness
The witness for the kickoff transactions input which is a winternitz signature that commits the payout blockhash.
spent_watchtower_utxos: HashSet<usize>
Set of indices of watchtower UTXOs that have already been spent.
latest_blockhash: Witness
The witness taken from the transaction spending the latest blockhash utxo.
watchtower_challenges: HashMap<usize, Transaction>
Saves watchtower challenges with the watchtower index as the key. Watchtower challenges are encoded as the output of the watchtower challenge tx. (taproot addresses parsed as 32 bytes + OP_RETURN data), in total 144 bytes.
operator_asserts: HashMap<usize, Witness>
Saves operator asserts with the index of the assert utxo as the key. Operator asserts are witnesses that spend the assert utxo’s and contain the winternitz signature of the BitVM assertion.
operator_challenge_acks: HashMap<usize, Witness>
Saves operator challenge acks with the index of the challenge ack utxo as the key. Operator challenge acks are witnesses that spend the challenge ack utxo’s. The witness contains the revealed preimage that can be used to disprove if the operator maliciously doesn’t include the watchtower challenge in the BitVM proof.
phantom: PhantomData<T>
Marker for the generic owner type (phantom data for type safety). This is used to ensure that the state machine is generic over the owner type.
Implementations§
Source§impl<T: Owner> KickoffStateMachine<T>
impl<T: Owner> KickoffStateMachine<T>
pub fn new( kickoff_data: KickoffData, kickoff_height: u32, deposit_data: DepositData, payout_blockhash: Witness, ) -> Self
Source§impl<T: Owner> KickoffStateMachine<T>
impl<T: Owner> KickoffStateMachine<T>
pub(crate) fn on_transition(&mut self, state_a: &State, state_b: &State)
pub fn kickoff_meta(&self, method: &'static str) -> StateMachineError
pub(crate) fn on_dispatch( &mut self, _state: StateOrSuperstate<'_, '_, Self>, evt: &KickoffEvent, )
Sourceasync fn create_matcher_for_latest_blockhash_if_ready(
&mut self,
context: &mut StateContext<T>,
)
async fn create_matcher_for_latest_blockhash_if_ready( &mut self, context: &mut StateContext<T>, )
Checks if the latest blockhash is ready to be committed on Bitcoin. The check is done by checking if all watchtower challenge utxos are spent. If the check is successful, the a new matcher is created to send latest blockhash tx after finality depth blocks pass from current block height.
Sourceasync fn disprove_if_ready(&mut self, context: &mut StateContext<T>)
async fn disprove_if_ready(&mut self, context: &mut StateContext<T>)
Checks if the disprove is ready to be sent on Bitcoin The check is done by checking if all operator asserts are received, latest blockhash is committed and all watchtower challenge utxos are spent If the check is successful, the disprove is sent on Bitcoin
Sourceasync fn send_operator_asserts_if_ready(
&mut self,
context: &mut StateContext<T>,
)
async fn send_operator_asserts_if_ready( &mut self, context: &mut StateContext<T>, )
Checks if the operator asserts are ready to be sent on Bitcoin The check is done by checking if all watchtower challenge utxos are spent and latest blockhash is committed If the check is successful, the operator asserts are sent on Bitcoin
async fn send_watchtower_challenge(&mut self, context: &mut StateContext<T>)
async fn send_disprove(&mut self, context: &mut StateContext<T>)
async fn send_latest_blockhash(&mut self, context: &mut StateContext<T>)
async fn unhandled_event( &mut self, context: &mut StateContext<T>, event: &KickoffEvent, )
Sourcepub(crate) async fn on_challenged_entry(
&mut self,
context: &mut StateContext<T>,
)
pub(crate) async fn on_challenged_entry( &mut self, context: &mut StateContext<T>, )
If the kickoff is challenged, the state machine will add corresponding matchers for sending watchtower challenges after some amount of blocks passes since the kickoff was included in Bitcoin. Sending watchtower challenges only happen if the kickoff is challenged. As sending latest blockhash commit and asserts depend on watchtower challenges/timeouts being sent, they will also not be sent if the kickoff is not challenged and kickoff finalizer is spent with ChallengeTimeout, which changes the state to “Closed”.
Sourcepub(crate) async fn challenged(
&mut self,
event: &KickoffEvent,
context: &mut StateContext<T>,
) -> Response<State>
pub(crate) async fn challenged( &mut self, event: &KickoffEvent, context: &mut StateContext<T>, ) -> Response<State>
State that is entered when the kickoff is challenged It only includes special handling for the TimeToSendWatchtowerChallenge event All other events are handled in the kickoff superstate
async fn kickoff( &mut self, event: &KickoffEvent, context: &mut StateContext<T>, ) -> Response<State>
Sourcepub(crate) async fn kickoff_started(
&mut self,
event: &KickoffEvent,
context: &mut StateContext<T>,
) -> Response<State>
pub(crate) async fn kickoff_started( &mut self, event: &KickoffEvent, context: &mut StateContext<T>, ) -> Response<State>
State that is entered when the kickoff is started It will transition to the “Challenged” state if the kickoff is challenged
Sourceasync fn add_default_kickoff_matchers(
&mut self,
context: &mut StateContext<T>,
) -> Result<(), BridgeError>
async fn add_default_kickoff_matchers( &mut self, context: &mut StateContext<T>, ) -> Result<(), BridgeError>
Adds the default matchers that will be used if the state is “challenged” or “kickoff_started”. These matchers are used to detect when various transactions in the contract are mined on Bitcoin.
pub(crate) async fn on_kickoff_started_entry( &mut self, context: &mut StateContext<T>, )
Sourcepub(crate) async fn on_closed_entry(&mut self, context: &mut StateContext<T>)
pub(crate) async fn on_closed_entry(&mut self, context: &mut StateContext<T>)
Clears all matchers when the state is “closed”. This means the state machine will not do any more actions anymore.
pub(crate) async fn closed( &mut self, event: &KickoffEvent, context: &mut StateContext<T>, ) -> Response<State>
Trait Implementations§
Source§impl<T: Owner> BlockMatcher for KickoffStateMachine<T>
impl<T: Owner> BlockMatcher for KickoffStateMachine<T>
type StateEvent = KickoffEvent
fn match_block(&self, block: &BlockCache) -> Vec<Self::StateEvent>
Source§impl<T: Clone + Owner> Clone for KickoffStateMachine<T>
impl<T: Clone + Owner> Clone for KickoffStateMachine<T>
Source§fn clone(&self) -> KickoffStateMachine<T>
fn clone(&self) -> KickoffStateMachine<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de, T: Owner> Deserialize<'de> for KickoffStateMachine<T>
impl<'de, T: Owner> Deserialize<'de> for KickoffStateMachine<T>
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>,
Source§impl<T: Owner> IntoStateMachine for KickoffStateMachine<T>
impl<T: Owner> IntoStateMachine for KickoffStateMachine<T>
Source§const ON_TRANSITION: fn(_: &mut Self, _: &Self::State, _: &Self::State) = Self::on_transition
const ON_TRANSITION: fn(_: &mut Self, _: &Self::State, _: &Self::State) = Self::on_transition
Source§const ON_DISPATCH: fn(_: &mut Self, _: StateOrSuperstate<'_, '_, Self>, _: &Self::Event<'_>) = Self::on_dispatch
const ON_DISPATCH: fn(_: &mut Self, _: StateOrSuperstate<'_, '_, Self>, _: &Self::Event<'_>) = Self::on_dispatch
Source§type Event<'event> = KickoffEvent
type Event<'event> = KickoffEvent
Source§type Context<'context> = StateContext<T>
type Context<'context> = StateContext<T>
Source§type Superstate<'sub> = Superstate
type Superstate<'sub> = Superstate
Source§impl<T: Owner> Serialize for KickoffStateMachine<T>
impl<T: Owner> Serialize for KickoffStateMachine<T>
Source§impl<T: Owner> State<KickoffStateMachine<T>> for State
impl<T: Owner> State<KickoffStateMachine<T>> for State
Source§fn call_handler<'fut>(
&'fut mut self,
shared_storage: &'fut mut KickoffStateMachine<T>,
event: &'fut <KickoffStateMachine<T> as IntoStateMachine>::Event<'_>,
context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>,
) -> Pin<Box<dyn Future<Output = Response<Self>> + Send + 'fut>>
fn call_handler<'fut>( &'fut mut self, shared_storage: &'fut mut KickoffStateMachine<T>, event: &'fut <KickoffStateMachine<T> as IntoStateMachine>::Event<'_>, context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>, ) -> Pin<Box<dyn Future<Output = Response<Self>> + Send + 'fut>>
Source§fn call_entry_action<'fut>(
&'fut mut self,
shared_storage: &'fut mut KickoffStateMachine<T>,
context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
fn call_entry_action<'fut>( &'fut mut self, shared_storage: &'fut mut KickoffStateMachine<T>, context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
Source§fn call_exit_action<'fut>(
&'fut mut self,
shared_storage: &'fut mut KickoffStateMachine<T>,
context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
fn call_exit_action<'fut>( &'fut mut self, shared_storage: &'fut mut KickoffStateMachine<T>, context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
Source§fn superstate(
&mut self,
) -> Option<<KickoffStateMachine<T> as IntoStateMachine>::Superstate<'_>>
fn superstate( &mut self, ) -> Option<<KickoffStateMachine<T> as IntoStateMachine>::Superstate<'_>>
Source§impl<'sub, T: Owner> Superstate<KickoffStateMachine<T>> for Superstatewhere
Self: 'sub,
impl<'sub, T: Owner> Superstate<KickoffStateMachine<T>> for Superstatewhere
Self: 'sub,
Source§fn call_handler<'fut>(
&'fut mut self,
shared_storage: &'fut mut KickoffStateMachine<T>,
event: &'fut <KickoffStateMachine<T> as IntoStateMachine>::Event<'_>,
context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>,
) -> Pin<Box<dyn Future<Output = Response<<KickoffStateMachine<T> as IntoStateMachine>::State>> + Send + 'fut>>
fn call_handler<'fut>( &'fut mut self, shared_storage: &'fut mut KickoffStateMachine<T>, event: &'fut <KickoffStateMachine<T> as IntoStateMachine>::Event<'_>, context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>, ) -> Pin<Box<dyn Future<Output = Response<<KickoffStateMachine<T> as IntoStateMachine>::State>> + Send + 'fut>>
Source§fn call_entry_action<'fut>(
&'fut mut self,
shared_storage: &'fut mut KickoffStateMachine<T>,
context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
fn call_entry_action<'fut>( &'fut mut self, shared_storage: &'fut mut KickoffStateMachine<T>, context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
Source§fn call_exit_action<'fut>(
&'fut mut self,
shared_storage: &'fut mut KickoffStateMachine<T>,
context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
fn call_exit_action<'fut>( &'fut mut self, shared_storage: &'fut mut KickoffStateMachine<T>, context: &'fut mut <KickoffStateMachine<T> as IntoStateMachine>::Context<'_>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'fut>>
Source§fn superstate(
&mut self,
) -> Option<<KickoffStateMachine<T> as IntoStateMachine>::Superstate<'_>>
fn superstate( &mut self, ) -> Option<<KickoffStateMachine<T> as IntoStateMachine>::Superstate<'_>>
impl<T: Eq + Owner> Eq for KickoffStateMachine<T>
impl<T: Owner> StructuralPartialEq for KickoffStateMachine<T>
Auto Trait Implementations§
impl<T> Freeze for KickoffStateMachine<T>
impl<T> RefUnwindSafe for KickoffStateMachine<T>where
T: RefUnwindSafe,
impl<T> Send for KickoffStateMachine<T>
impl<T> Sync for KickoffStateMachine<T>
impl<T> Unpin for KickoffStateMachine<T>where
T: Unpin,
impl<T> UnwindSafe for KickoffStateMachine<T>where
T: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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
§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.