#[non_exhaustive]pub enum BuildError {
DuplicateErrorHook,
DuplicateMethod(String),
ReservedMethod(String),
DuplicateCommand(String),
EmptyCommandName,
ExecuteCommandConflict,
ConflictingCapability {
field: &'static str,
},
DuplicateConfigureInitialize,
DuplicateLifecycleHook(&'static str),
InvalidConcurrencyLimit,
InvalidOutboundWarningThreshold,
InvalidResourcePolicy {
field: ResourcePolicyField,
},
}Expand description
A configuration error surfaced by ServerBuilder::build.
BuildError is deliberately distinct from LspError: it names a static
registration mistake the developer must fix before the server ever runs,
never a value that goes on the wire. build() performs no I/O and returns
this before any transport is touched.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DuplicateErrorHook
More than one connection-level error hook was registered.
DuplicateMethod(String)
Two handlers were registered for the same request method.
ReservedMethod(String)
A custom request or notification was registered under a method the
framework owns (initialize, shutdown, exit, initialized,
$/cancelRequest).
DuplicateCommand(String)
Two handlers were registered for the same command name.
EmptyCommandName
A command was registered with an empty name; a command name is the key
the editor sends on workspace/executeCommand, so it cannot be empty.
ExecuteCommandConflict
One or more commands were registered alongside an explicit
workspace/executeCommand request handler. Commands already dispatch
beneath that method, so a user handler for it would shadow them.
ConflictingCapability
Two contributions disagreed on a capability field that must be singular within its family, or a dependent feature was registered without the base its family requires (ADR 0017). Capability construction never resolves such a clash by last-write-wins; it fails the build instead.
DuplicateConfigureInitialize
configure_initialize was supplied more than once. There is exactly one
initialization-dependent registration transaction (ADR 0017).
DuplicateLifecycleHook(&'static str)
A lifecycle hook (on_initialize, …) was supplied more than once. Each
hook has at most one registration (ADR 0018).
InvalidConcurrencyLimit
A zero concurrency limit could never admit a user call.
InvalidOutboundWarningThreshold
A zero outbound warning threshold could never be crossed from below.
InvalidResourcePolicy
A connection resource budget or enabled deadline was zero.
Fields
field: ResourcePolicyFieldThe invalid ResourcePolicy field.
Trait Implementations§
Source§impl Debug for BuildError
impl Debug for BuildError
Source§impl Display for BuildError
impl Display for BuildError
impl Eq for BuildError
Source§impl Error for BuildError
impl Error for BuildError
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()