pub enum BindError {
NotFound(String),
Closed(String),
AlreadyBound(String),
Store(StoreError),
}Expand description
Typed failure surface for WorkstreamStore::bind_session (issue
#3298).
Why: a SEPARATE enum from StoreError rather than two new variants on
it — StoreError already has non-exhaustive matches at existing call
sites outside this ticket’s file ownership (workstreams::sse’s own
map_store_err, owned by the concurrent sibling ticket #3299), which
widening StoreError would silently break. BindError::Store wraps
every other StoreError variant unchanged.
What: Self::NotFound — the target workstream does not exist.
Self::Closed — DOC-48 §4.1/§4.4: “If a workstream is closed, new
sessions may not bind to it”. Self::AlreadyBound — DOC-48 §2: a
session appears in at most one workstream’s session_ids; this session
id is already bound to a DIFFERENT workstream.
Test: store_tests::bind_session_rejects_unknown_workstream,
store_tests::bind_session_rejects_closed_workstream,
store_tests::bind_session_rejects_double_binding_to_different_workstream.
Variants§
Trait Implementations§
Source§impl Error for BindError
impl Error for BindError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<StoreError> for BindError
impl From<StoreError> for BindError
Source§fn from(source: StoreError) -> Self
fn from(source: StoreError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for BindError
impl !UnwindSafe for BindError
impl Freeze for BindError
impl Send for BindError
impl Sync for BindError
impl Unpin for BindError
impl UnsafeUnpin for BindError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more