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

#[must_use]
pub struct Tip { /* fields omitted */ }

Represents tip parameters.

Implementations

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

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.