StreamError

Enum StreamError 

Source
#[repr(u32)]
pub enum StreamError {
Show 40 variants EmptyRecipient = 0, SameSenderAndRecipient = 1, SameSenders = 2, SameRecipients = 3, InvalidNewSender = 4, InvalidSender = 5, InvalidRecipient = 6, StreamNameTooShort = 7, StreamNameTooLong = 8, ZeroFlowInterval = 9, InvalidEndsAt = 10, ZeroLifetimeAmount = 11, ZeroAmount = 12, PrepaidAmountNeededOutOfBounds = 13, DepositAmountNeededOutOfBounds = 14, AmountLessThanAmountNeeded = 15, UserUnauthorizedToWithdraw = 16, WithdrawnAmountGreaterThanAmountOwed = 17, WithdrawAmountOutOfBounds = 18, AmountAvailableToWithdrawOutOfBounds = 19, CancellationRefundOutOfBounds = 20, TopupAmountOutOfBounds = 21, TopupAmountMoreThanMaxAcceptable = 22, SenderInsufficientFunds = 23, EscrowInsufficientFunds = 24, EscrowNotRentExempt = 25, StreamAlreadyCancelled = 26, UserUnauthorizedToCancel = 27, SenderCannotCancel = 28, StreamIsPrepaid = 29, StreamHasStopped = 30, StreamIsPaused = 31, StreamIsNotPaused = 32, StreamHasNoFlowPayments = 33, SenderCannotChangeSender = 34, SenderCannotPause = 35, RecipientCannotResumePauseBySender = 36, UserUnauthorizedToPause = 37, UserUnauthorizedToResume = 38, StreamNotEnded = 39,
}
Expand description

Enumeration of possible stream errors.

Variants§

§

EmptyRecipient = 0

The stream recipient is empty. Should be a valid address.

§

SameSenderAndRecipient = 1

The stream recipient is the same as the sender. Should be different addresses.

§

SameSenders = 2

The stream sender is the same as the new sender. Should be different addresses.

§

SameRecipients = 3

The stream recipient is the same as the new recipient. Should be different addresses.

§

InvalidNewSender = 4

The new sender is invalid.

§

InvalidSender = 5

The sender is invalid.

§

InvalidRecipient = 6

The recipient is invalid.

§

StreamNameTooShort = 7

The stream name is too short. Should be >= 2 chars.

§

StreamNameTooLong = 8

The stream name is too long. Should be <= 100 chars.

§

ZeroFlowInterval = 9

The flow interval is 0. Should be > 0.

§

InvalidEndsAt = 10

The end time is either 0 with prepaid = true, in the past or < starts_at. Should be >= current_time and

= starts_at or if the stream is not prepaid, it can be 0.

§

ZeroLifetimeAmount = 11

The stream will never lead to any payments. Either there should be a initial amount or flow rate and flow duration should be > 0.

§

ZeroAmount = 12

The amount cannot be 0. Should be > 0.

§

PrepaidAmountNeededOutOfBounds = 13

The prepaid amount needed by the stream is out of bounds.

§

DepositAmountNeededOutOfBounds = 14

The deposit amount needed by the non-prepaid stream is out of bounds.

§

AmountLessThanAmountNeeded = 15

The amount is less than the minimum initial amount needed.

§

UserUnauthorizedToWithdraw = 16

The user is not allowed to withdraw. Should be the recipient of the stream.

§

WithdrawnAmountGreaterThanAmountOwed = 17

The withdrawn amount by recipient is more than the amount owed. THIS SHOULD NOT HAVE HAPPENED!!!

§

WithdrawAmountOutOfBounds = 18

The total withdrawn amount by the recipient of the stream is out of bounds.

§

AmountAvailableToWithdrawOutOfBounds = 19

The amount available to be withdrawn by the recipient of the stream is out of bounds.

§

CancellationRefundOutOfBounds = 20

The cancellation refund amount to the sender of the stream is out of bounds.

§

TopupAmountOutOfBounds = 21

The total topup amount by the sender of the stream is out of bounds.

§

TopupAmountMoreThanMaxAcceptable = 22

The topup amount is more than what is needed by the stream.

§

SenderInsufficientFunds = 23

The sender has insufficient balance in their token account.

§

EscrowInsufficientFunds = 24

The token escrow account has insufficient balance. THIS SHOULD NOT HAVE HAPPENED!!!

§

EscrowNotRentExempt = 25

The token escrow account is not rent exempt.

§

StreamAlreadyCancelled = 26

The stream has already been cancelled.

§

UserUnauthorizedToCancel = 27

The user is not allowed to cancel. Should be the sender or the recipient of the stream.

§

SenderCannotCancel = 28

The sender is not allowed to cancel permanently or at the moment.

§

StreamIsPrepaid = 29

The stream is prepaid. Should be a non-prepaid stream.

§

StreamHasStopped = 30

The stream has already stopped. Should be an unstopped stream.

§

StreamIsPaused = 31

The stream is already paused. Should be a non-paused stream.

§

StreamIsNotPaused = 32

The stream is not paused. Should be a paused stream.

§

StreamHasNoFlowPayments = 33

The stream has no flow payments. Should be a stream stream with a positive flow rate and flow period.

§

SenderCannotChangeSender = 34

The sender is not allowed to change sender of the stream permanently or at the moment.

§

SenderCannotPause = 35

The sender is not allowed to pause stream permanently or at the moment.

§

RecipientCannotResumePauseBySender = 36

The recipient is not allowed resume a stream paused by sender permanently or at the moment.

§

UserUnauthorizedToPause = 37

The user is not allowed to pause. Should be the sender or the recipient of the stream.

§

UserUnauthorizedToResume = 38

The user is not allowed to resume. Should be the sender or the recipient of the stream.

§

StreamNotEnded = 39

The stream has not ended. Should have ended and nat been cancelled.

Implementations§

Source§

impl StreamError

Source

pub fn name(&self) -> String

Gets the name of this [#enum_name].

Trait Implementations§

Source§

impl Clone for StreamError

Source§

fn clone(&self) -> StreamError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StreamError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for StreamError

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<StreamError> for Error

Source§

fn from(error_code: StreamError) -> Error

Converts to this type from the input type.
Source§

impl From<StreamError> for u32

Source§

fn from(e: StreamError) -> u32

Converts to this type from the input type.
Source§

impl Copy for StreamError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AbiExample for T

Source§

default fn example() -> T

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V