pub enum FrameError {
MissingContentLength,
InvalidContentLength(String),
MalformedHeader(String),
NonAsciiHeader,
DuplicateContentLength,
OverlargeMessage {
got: u64,
limit: u64,
},
}Expand description
Header-parse failures.
Variants§
MissingContentLength
Header block contained no Content-Length field. The
LSP base protocol says it MUST be present; any message
missing it is unframable.
InvalidContentLength(String)
Content-Length value didn’t parse as an unsigned
integer.
MalformedHeader(String)
Header line lacked the name: value separator. ASCII
only; whitespace around : is tolerated.
NonAsciiHeader
Header bytes were not valid ASCII (or the bytes before the body terminator weren’t, which forces a teardown).
DuplicateContentLength
Two Content-Length fields in the same header block.
The LSP base protocol doesn’t say what to do; we reject.
Forwarding the wrong length would either truncate the
body or read past it into the next message.
OverlargeMessage
Content length exceeds the configured per-message ceiling. Defends against a malicious / runaway server pinning a gigabyte of memory per message.
Trait Implementations§
Source§impl Debug for FrameError
impl Debug for FrameError
Source§impl Display for FrameError
impl Display for FrameError
impl Eq for FrameError
Source§impl Error for FrameError
impl Error for FrameError
1.30.0 · 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<FrameError> for LspError
impl From<FrameError> for LspError
Source§fn from(source: FrameError) -> Self
fn from(source: FrameError) -> Self
Source§impl PartialEq for FrameError
impl PartialEq for FrameError
impl StructuralPartialEq for FrameError
Auto Trait Implementations§
impl Freeze for FrameError
impl RefUnwindSafe for FrameError
impl Send for FrameError
impl Sync for FrameError
impl Unpin for FrameError
impl UnsafeUnpin for FrameError
impl UnwindSafe for FrameError
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more