Skip to main content

ResumeError

Enum ResumeError 

Source
pub enum ResumeError {
    NotFound(SessionId),
    NotPaused {
        actual_tag: ExecutionStateTag,
    },
    AlreadyCancelled,
    FeedError(String),
}
Expand description

Error returned by crate::execution::ExecutionService::resume.

§Note on #[from] and serde compatibility

FeedError (from crates/algocline-core/src/state.rs) does not derive serde::Serialize + serde::Deserialize, so we cannot use #[from] FeedError directly on a serde-enabled enum. Instead, the FeedError variant stores the display string, and a manual From<FeedError> impl converts it.

Subtask 2 may add From<SessionError> to this enum; if a second #[from] conversion causes a trait impl conflict (K-79), the later conversion must use map_err instead.

Variants§

§

NotFound(SessionId)

No session with the given id exists in the registry.

§

NotPaused

The session exists but is not in the Paused state.

Fields

§actual_tag: ExecutionStateTag

The state the session is actually in.

§

AlreadyCancelled

The session is already cancelled; resuming is a no-op that returns this error so callers are explicitly informed.

§

FeedError(String)

The feed operation on the underlying session failed.

The original FeedError message is preserved as a String because FeedError does not implement serde::Serialize + serde::Deserialize.

Trait Implementations§

Source§

impl Debug for ResumeError

Source§

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

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

impl<'de> Deserialize<'de> for ResumeError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ResumeError

Source§

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

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

impl Error for ResumeError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<FeedError> for ResumeError

Source§

fn from(e: FeedError) -> Self

Converts a FeedError into a ResumeError::FeedError by formatting the error message. This preserves the error chain for callers while remaining serde-compatible.

Source§

impl Serialize for ResumeError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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.