pub enum ProtocolError {
UnknownDocument(DocumentId),
PositionOutOfBounds {
position: Position,
line_count: u32,
},
StaleVersion {
client: u64,
actual: u64,
},
InvalidRange(&'static str),
}Expand description
A request that is structurally well-formed but does not fit the document
it addresses. Crate errors wrap it (lattice_core’s CoreError::Protocol)
rather than redefine these cases.
Variants§
UnknownDocument(DocumentId)
No document with this id exists (it was never opened, or was closed).
PositionOutOfBounds
A Position names a line past the end of the document, or a byte
past the end of its line. lattice_core::Buffer raises it on edit
and position conversion.
Fields
StaleVersion
A write was computed against an older document version than the current one (optimistic concurrency).
Fields
InvalidRange(&'static str)
A Range is malformed — typically end before
start. The payload is a fixed, human-readable reason.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnsafeUnpin for ProtocolError
impl UnwindSafe for ProtocolError
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
Mutably borrows from an owned value. Read more