pub struct AdapterRegistration {
pub name: &'static str,
pub known_params: fn() -> &'static [&'static str],
pub display_preference: fn(&HashMap<String, String>) -> DisplayPreference,
pub supported_controls: fn() -> &'static [ControlDesc],
pub create: fn(HashMap<String, String>) -> CreateAdapterFuture,
}Expand description
An adapter module’s registration, submitted at link time via inventory.
Each adapter crate (nmbrs-adapter-stdout, nmbrs-adapter-cql, etc.) submits one of these. The shared runner collects all submissions to build the adapter dispatch table without any explicit adapter list.
Fields§
§name: &'static strThe one name adapter= selects this adapter by (e.g. "stdout", "cql").
known_params: fn() -> &'static [&'static str]Extra param names this adapter accepts (for CLI validation).
display_preference: fn(&HashMap<String, String>) -> DisplayPreferenceDisplay preference for TUI activation. Checked at startup before
any adapter is constructed — no connection overhead. Takes the
run params so an adapter whose terminal use depends on config can
decide (e.g. stdout wants the TUI off when it writes op output
to the console, but is TUI-compatible when filename= redirects
to a file).
supported_controls: fn() -> &'static [ControlDesc]SRD-23 — the dynamic controls this adapter can declare, as static
ControlDesc capability
descriptors. This is the discovery surface (nmbrs describe controls
/ describe adapter=<name>), read without constructing the adapter;
the adapter’s declare_controls
derives the live control from the same descriptors so the two cannot
drift. Default || &[] for adapters with no dynamic knobs.
create: fn(HashMap<String, String>) -> CreateAdapterFutureAsync factory: given params, create the adapter. Returns a boxed future so async connect is supported (e.g., CQL).
Trait Implementations§
impl Collect for AdapterRegistration
Auto Trait Implementations§
impl Forget for AdapterRegistration
impl Freeze for AdapterRegistration
impl Move for AdapterRegistration
impl RefUnwindSafe for AdapterRegistration
impl Send for AdapterRegistration
impl Sync for AdapterRegistration
impl Unpin for AdapterRegistration
impl UnsafeUnpin for AdapterRegistrationwhere
&'static str: UnsafeUnpin,
impl UnwindSafe for AdapterRegistrationwhere
&'static str: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more