pub trait EntryMapper: Sync {
// Required methods
fn to_native(
&self,
server: &RenderedServer,
cx: &WriteCx<'_>,
) -> Result<NativeValue, MapError>;
fn from_native(
&self,
key: &str,
value: &NativeValue,
) -> Result<ServerDef, MapError>;
fn canonical(&self, value: &NativeValue) -> Canonical;
// Provided method
fn skipped_by_client(&self, _value: &NativeValue) -> Option<&'static str> { ... }
}Expand description
Maps one server to and from a client’s native entry.
Required Methods§
fn to_native( &self, server: &RenderedServer, cx: &WriteCx<'_>, ) -> Result<NativeValue, MapError>
Sourcefn from_native(
&self,
key: &str,
value: &NativeValue,
) -> Result<ServerDef, MapError>
fn from_native( &self, key: &str, value: &NativeValue, ) -> Result<ServerDef, MapError>
Reads the entry key back. Named as in SPEC 7.1, hence the lint.
Sourcefn canonical(&self, value: &NativeValue) -> Canonical
fn canonical(&self, value: &NativeValue) -> Canonical
Sorted, client defaults dropped; used for equality and hashing.
Provided Methods§
Sourcefn skipped_by_client(&self, _value: &NativeValue) -> Option<&'static str>
fn skipped_by_client(&self, _value: &NativeValue) -> Option<&'static str>
Why the client itself does not load this entry, when it does not
(gate V1 CC-5: Claude Code skips a url entry without type). Such
an entry still reads back, so import can take it, but importing it
starts a server the client never ran.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".