Struct tbot::types::parameters::Tip[][src]

pub struct Tip { /* fields omitted */ }

Represents tip parameters.


impl Tip[src]

pub const fn with_max(max_tip: u32) -> Self[src]

Constructs a Tip with the given max tip amount. Reflects the max_tip_amount parameter.

pub fn suggested_tips(self, tips: impl Into<Vec<u32>>) -> Self[src]

Configures suggested tip amounts for the invoice. At most 4 suggestions can be specified; this method automatically sorts them. Reflects the suggested_tip_amounts parameter.


Panics if:

  • there are 0 or more than 4 tips;
  • there are duplicated tips;
  • the biggest tip exceeds max_tip_amount.

Trait Implementations

impl Clone for Tip[src]

impl Debug for Tip[src]

impl Hash for Tip[src]

impl PartialEq<Tip> for Tip[src]

impl Serialize for Tip[src]

impl Eq for Tip[src]

impl StructuralEq for Tip[src]

impl StructuralPartialEq for Tip[src]

Auto Trait Implementations

impl RefUnwindSafe for Tip

impl Send for Tip

impl Sync for Tip

impl Unpin for Tip

impl UnwindSafe for Tip

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.