#[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.
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.
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.
The user is not allowed to pause. Should be the sender or the recipient of the stream.
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§
Trait Implementations§
Source§impl Clone for StreamError
impl Clone for StreamError
Source§fn clone(&self) -> StreamError
fn clone(&self) -> StreamError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for StreamError
impl Debug for StreamError
Source§impl Display for StreamError
impl Display for StreamError
Source§impl From<StreamError> for Error
impl From<StreamError> for Error
Source§fn from(error_code: StreamError) -> Error
fn from(error_code: StreamError) -> Error
Source§impl From<StreamError> for u32
impl From<StreamError> for u32
Source§fn from(e: StreamError) -> u32
fn from(e: StreamError) -> u32
impl Copy for StreamError
Auto Trait Implementations§
impl Freeze for StreamError
impl RefUnwindSafe for StreamError
impl Send for StreamError
impl Sync for StreamError
impl Unpin for StreamError
impl UnwindSafe for StreamError
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,
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 more