Struct farcaster_core::protocol::Bob
source · pub struct Bob<Addr, Ar, Ac> {
pub arbitrating: Ar,
pub accordant: Ac,
pub refund_address: Addr,
pub fee_politic: FeePriority,
}
Expand description
Bob, a SwapRole
, starts with arbitrating blockchain assets and exchange them for accordant
blockchain assets.
Fields§
§arbitrating: Ar
The arbitrating blockchain to use during the swap
accordant: Ac
The accordant blockchain to use during the swap
refund_address: Addr
An arbitrating address where, if unsuccessfully executed, the funds exchanged will be sent back to
fee_politic: FeePriority
The fee politic to apply during the swap fee calculation
Implementations§
source§impl<Addr, Ar, Ac> Bob<Addr, Ar, Ac>
impl<Addr, Ar, Ac> Bob<Addr, Ar, Ac>
sourcepub fn new(
arbitrating: Ar,
accordant: Ac,
refund_address: Addr,
fee_politic: FeePriority
) -> Self
pub fn new(
arbitrating: Ar,
accordant: Ac,
refund_address: Addr,
fee_politic: FeePriority
) -> Self
Create a new Bob
role with the local parameters.
source§impl<Addr, Ar, Ac> Bob<Addr, Ar, Ac>where
Addr: Clone,
impl<Addr, Ar, Ac> Bob<Addr, Ar, Ac>where
Addr: Clone,
sourcepub fn generate_parameters<Amt, Bmt, Pk, Qk, Rk, Sk, Ti, F, Pr, Kg>(
&self,
key_gen: &mut Kg,
deal: &Deal<Amt, Bmt, Ti, F>
) -> Res<Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>>where
Ar: DeriveKeys<PublicKey = Pk, PrivateKey = Rk>,
Ac: DeriveKeys<PublicKey = Qk, PrivateKey = Sk>,
Ti: Copy,
F: Clone,
Kg: KeyGenerator<Pk, Qk, Rk, Sk, Pr>,
pub fn generate_parameters<Amt, Bmt, Pk, Qk, Rk, Sk, Ti, F, Pr, Kg>(
&self,
key_gen: &mut Kg,
deal: &Deal<Amt, Bmt, Ti, F>
) -> Res<Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>>where
Ar: DeriveKeys<PublicKey = Pk, PrivateKey = Rk>,
Ac: DeriveKeys<PublicKey = Qk, PrivateKey = Sk>,
Ti: Copy,
F: Clone,
Kg: KeyGenerator<Pk, Qk, Rk, Sk, Pr>,
Generate Bob’s parameters for the protocol execution based on a key generator.
Safety
All the data passed to the function are considered trusted and does not require extra validation. The deal is assumend to be validated by user upfront.
sourcepub fn core_arbitrating_transactions<Amt, Tx, Px, Pk, Qk, Rk, Sk, Ti, F, Pr, Out>(
&self,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
bob_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
funding: impl Fundable<Tx, Out, Addr, Pk>,
arb_params: ArbitratingParameters<Amt, Ti, F>
) -> Res<CoreArbitratingTransactions<Px>>where
Ar: Transactions<Addr = Addr, Amt = Amt, Tx = Tx, Out = Out, Ti = Ti, Pk = Pk, Px = Px>,
Px: Fee<FeeUnit = F>,
Out: Eq,
Pk: Copy,
Amt: Copy,
Ti: Copy,
pub fn core_arbitrating_transactions<Amt, Tx, Px, Pk, Qk, Rk, Sk, Ti, F, Pr, Out>(
&self,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
bob_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
funding: impl Fundable<Tx, Out, Addr, Pk>,
arb_params: ArbitratingParameters<Amt, Ti, F>
) -> Res<CoreArbitratingTransactions<Px>>where
Ar: Transactions<Addr = Addr, Amt = Amt, Tx = Tx, Out = Out, Ti = Ti, Pk = Pk, Px = Px>,
Px: Fee<FeeUnit = F>,
Out: Eq,
Pk: Copy,
Amt: Copy,
Ti: Copy,
Initialize the core arbitrating transactions composed of: Lockable
, Cancelable
, and
Refundable
transactions.
Safety
Alice’s Parameters
(i.e. counter-party parameters) are created and validated with the
protocol messages that commit and reveal the values.
This function assumes that the commit/reveal scheme has been validated and assumes that all cryptographic proof needed for securing the system have passed the validation.
Previously verified data:
alice_parameters
: Alice’s parametersarb_params
: The core arbitrating parameter used in verification
Trusted data:
bob_parameters
: Bob’s own parametersfunding
: Bob’s own funding transaction
Execution
The parameters to create the three transactions are:
- Alice’s public keys present in Alice’s
Parameters
- Bob’s public keys present in Bob’s
Parameters
- The
Fundable
transaction - The
FeeStrategy
and theFeePriority
The lock transaction is initialized by passing the DataLock
structure, then the cancel
transaction is initialized based on the lock transaction with the DataPunishableLock
structure, then the punish is initialized based on the cancel transaction.
Transaction Fee
The fee on each transactions are set according to the FeeStrategy
specified in the deal
and the FeePriority
in self
.
sourcepub fn cosign_arbitrating_cancel<S, Px, Si, Pk, Ms>(
&self,
wallet: &mut S,
core: &CoreArbitratingTransactions<Px>
) -> Res<Si>where
S: Sign<Pk, Ms, Si>,
Ar: Transactions<Addr = Addr, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone,
pub fn cosign_arbitrating_cancel<S, Px, Si, Pk, Ms>(
&self,
wallet: &mut S,
core: &CoreArbitratingTransactions<Px>
) -> Res<Si>where
S: Sign<Pk, Ms, Si>,
Ar: Transactions<Addr = Addr, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone,
Co-sign the arbitrating Cancelable
transaction.
Safety
All the data passed to cosign_arbitrating_cancel
are considered trusted.
The signature is created by Bob and does not require any extra validation.
Execution
- Parse the
Cancelable
partial transaction inCoreArbitratingTransactions
- Retreive the cancel public key from the paramters
- Generate the witness data and sign it
Returns the signature.
sourcepub fn validate_adaptor_refund<Amt, Px, Pk, Qk, Rk, Sk, Ti, F, Pr, S, Ms, Si, EncSig>(
&self,
wallet: &mut S,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
bob_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
core: &CoreArbitratingTransactions<Px>,
refund_adaptor_sig: &EncSig
) -> Res<()>where
S: EncSign<Pk, Ms, Si, EncSig>,
Ar: Transactions<Addr = Addr, Amt = Amt, Ti = Ti, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone,
pub fn validate_adaptor_refund<Amt, Px, Pk, Qk, Rk, Sk, Ti, F, Pr, S, Ms, Si, EncSig>(
&self,
wallet: &mut S,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
bob_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
core: &CoreArbitratingTransactions<Px>,
refund_adaptor_sig: &EncSig
) -> Res<()>where
S: EncSign<Pk, Ms, Si, EncSig>,
Ar: Transactions<Addr = Addr, Amt = Amt, Ti = Ti, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone,
Validates the adaptor refund witness based on the parameters and the core arbitrating transactions.
Safety
Alice’s Parameters
(i.e. counter-party parameters) are created and validated with the
protocol messages that commit and reveal the values.
This function assumes that the commit/reveal scheme has been validated and assumes that all cryptographic proof needed for securing the system have passed the validation.
CoreArbitratingTransactions
protocol message is created by Bob and does not require any
extra validation.
Previously verified data:
alice_parameters
: Alice’s parameters
Trusted data:
bob_parameters
: Bob’s own parameterscore
: Core arbitrating transactions
Verified data:
refund_adaptor_sig
: The adaptor witness to verify
Execution
- Parse the
Refundable
partial transaction inCoreArbitratingTransactions
- Verify the adaptor witness with the public keys from the parameters
Return Ok(())
if all tests succeed.
sourcepub fn sign_adaptor_buy<Amt, Px, Pk, Qk, Rk, Sk, Ti, F, Pr, S, Ms, Si, EncSig, U>(
&self,
swap_id: U,
wallet: &mut S,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
bob_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
core: &CoreArbitratingTransactions<Px>,
arb_params: ArbitratingParameters<Amt, Ti, F>
) -> Res<BuyProcedureSignature<Px, EncSig>>where
S: EncSign<Pk, Ms, Si, EncSig>,
Ar: Transactions<Addr = Addr, Amt = Amt, Ti = Ti, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone + Fee<FeeUnit = F>,
Pk: Copy,
Ti: Copy,
U: Into<SwapId>,
pub fn sign_adaptor_buy<Amt, Px, Pk, Qk, Rk, Sk, Ti, F, Pr, S, Ms, Si, EncSig, U>(
&self,
swap_id: U,
wallet: &mut S,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
bob_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
core: &CoreArbitratingTransactions<Px>,
arb_params: ArbitratingParameters<Amt, Ti, F>
) -> Res<BuyProcedureSignature<Px, EncSig>>where
S: EncSign<Pk, Ms, Si, EncSig>,
Ar: Transactions<Addr = Addr, Amt = Amt, Ti = Ti, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone + Fee<FeeUnit = F>,
Pk: Copy,
Ti: Copy,
U: Into<SwapId>,
Creates the Buyable
transaction and generate the adaptor witness
Safety
This function MUST NOT be run if validate_adaptor_refund
is not successful.
This function MUST NOT be run if the accordant assets are not confirmed on-chain.
Alice’s Parameters
(i.e. counter-party parameters) are created and validated with the
protocol messages that commit and reveal the values.
This function assumes that the commit/reveal scheme has been validated and assumes that all cryptographic proof needed for securing the system have passed the validation.
CoreArbitratingTransactions
protocol message is created by Bob and does not require any
extra validation.
Previously verified data:
alice_parameters
: Alice’s parametersarb_params
: The parameters used to verify core
Trusted data:
wallet
: Bob’s own wallet, used to perform cryptographic operationsbob_parameters
: Bob’s own parameterscore
: Core arbitrating transactions
Execution
- Parse the
Lockable
partial transaction inCoreArbitratingTransactions
- Generate the
DataLock
structure from Alice and Bob parameters and the deal - Retrieve Alice’s adaptor public key from Alice’s
Parameters
- Retreive the buy public key from the paramters
- Generate the adaptor witness data and sign it
Returns the partial transaction and the signature inside the BuyProcedureSignature
protocol message.
sourcepub fn sign_arbitrating_lock<S, Px, Si, Pk, Ms>(
&self,
wallet: &mut S,
core: &CoreArbitratingTransactions<Px>
) -> Res<Si>where
S: Sign<Pk, Ms, Si>,
Ar: Transactions<Addr = Addr, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone,
pub fn sign_arbitrating_lock<S, Px, Si, Pk, Ms>(
&self,
wallet: &mut S,
core: &CoreArbitratingTransactions<Px>
) -> Res<Si>where
S: Sign<Pk, Ms, Si>,
Ar: Transactions<Addr = Addr, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
Px: Clone,
Sign the arbitrating Lockable
transaction and return the signature.
Safety
This function MUST NOT be run if validate_adaptor_refund
is not successful.
All the data passed to sign_arbitrating_lock
are considered trusted.
CoreArbitratingTransactions
protocol message is created by Bob and does not require any
extra validation.
Execution
- Parse the
Lockable
partial transaction inCoreArbitratingTransactions
- Retreive the funding public key from the paramters
- Generate the witness data and sign it
Returns the signature.
sourcepub fn fully_sign_refund<S, Px, Si, Pk, Ms, EncSig>(
&self,
wallet: &mut S,
core: &CoreArbitratingTransactions<Px>,
signed_adaptor_refund: &EncSig
) -> Res<TxSignatures<Si>>where
S: Sign<Pk, Ms, Si> + EncSign<Pk, Ms, Si, EncSig>,
Ar: Transactions<Addr = Addr, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
EncSig: Clone,
Px: Clone,
pub fn fully_sign_refund<S, Px, Si, Pk, Ms, EncSig>(
&self,
wallet: &mut S,
core: &CoreArbitratingTransactions<Px>,
signed_adaptor_refund: &EncSig
) -> Res<TxSignatures<Si>>where
S: Sign<Pk, Ms, Si> + EncSign<Pk, Ms, Si, EncSig>,
Ar: Transactions<Addr = Addr, Ms = Ms, Pk = Pk, Si = Si, Px = Px>,
EncSig: Clone,
Px: Clone,
Sign the arbitrating Refundable
transaction and adapt the counter-party adaptor witness
with the private adaptor key.
Safety
This function MUST NOT be run if validate_adaptor_refund
is not successful.
The encrypted signature is created by Alice and must be verified to be a valid.
This function assumes that the adaptor signature has been validated and assumes that all cryptographic proof needed for securing the system have passed the validation.
CoreArbitratingTransactions
protocol message is created by Bob and does not require any
extra validation.
Execution
- Parse the
Refundable
partial transaction inCoreArbitratingTransactions
- Retreive the refund public key from the paramters
- Generate the refund witness data
- Retreive the adaptor public key from the pamaters
- Adapt the signature
Returns the signatures inside a TxSignatures
structure.
sourcepub fn recover_accordant_key<S, Tx, Px, Si, Pk, Qk, Rk, Sk, Ti, F, Pr, EncSig>(
&self,
wallet: &mut S,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
buy_adaptor_sig: EncSig,
buy_tx: Tx
) -> Rkwhere
S: RecoverSecret<Pk, Rk, Si, EncSig>,
Ar: Transactions<Addr = Addr, Tx = Tx, Px = Px, Pk = Pk, Si = Si>,
pub fn recover_accordant_key<S, Tx, Px, Si, Pk, Qk, Rk, Sk, Ti, F, Pr, EncSig>(
&self,
wallet: &mut S,
alice_parameters: &Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr>,
buy_adaptor_sig: EncSig,
buy_tx: Tx
) -> Rkwhere
S: RecoverSecret<Pk, Rk, Si, EncSig>,
Ar: Transactions<Addr = Addr, Tx = Tx, Px = Px, Pk = Pk, Si = Si>,
This function allows to recover the secret key used to encrypt the buy signature, allowing Bob to recover Alice’s secret and transfer ownership of funds.
Trait Implementations§
source§impl<Addr, Ar, Ac> Decodable for Bob<Addr, Ar, Ac>where
Ar: Decodable,
Ac: Decodable,
Addr: CanonicalBytes,
impl<Addr, Ar, Ac> Decodable for Bob<Addr, Ar, Ac>where
Ar: Decodable,
Ac: Decodable,
Addr: CanonicalBytes,
Auto Trait Implementations§
impl<Addr, Ar, Ac> RefUnwindSafe for Bob<Addr, Ar, Ac>where
Ac: RefUnwindSafe,
Addr: RefUnwindSafe,
Ar: RefUnwindSafe,
impl<Addr, Ar, Ac> Send for Bob<Addr, Ar, Ac>where
Ac: Send,
Addr: Send,
Ar: Send,
impl<Addr, Ar, Ac> Sync for Bob<Addr, Ar, Ac>where
Ac: Sync,
Addr: Sync,
Ar: Sync,
impl<Addr, Ar, Ac> Unpin for Bob<Addr, Ar, Ac>where
Ac: Unpin,
Addr: Unpin,
Ar: Unpin,
impl<Addr, Ar, Ac> UnwindSafe for Bob<Addr, Ar, Ac>where
Ac: UnwindSafe,
Addr: UnwindSafe,
Ar: UnwindSafe,
Blanket Implementations§
§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,
source§impl<T> Mark for T
impl<T> Mark for T
source§fn mark<M>(self) -> <M as ChangeMark<T>>::Outwhere
M: ChangeMark<T>,
fn mark<M>(self) -> <M as ChangeMark<T>>::Outwhere
M: ChangeMark<T>,
M
. Read more§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) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
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) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
self
, then passes self.as_mut()
into the pipe
function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
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)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.