pub struct CursorAdapter;Expand description
Zero-sized marker — no adapter-local state.
Trait Implementations§
Source§impl PlatformAdapter for CursorAdapter
impl PlatformAdapter for CursorAdapter
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable identifier used in logs + telemetry. Must match the string
get_platform_adapter dispatches on so adapter.name() == requested_name round-trips.Source§fn parse_stdin(&self, raw: &str) -> Result<HookEvent, String>
fn parse_stdin(&self, raw: &str) -> Result<HookEvent, String>
Parse a single hook invocation’s stdin payload into our canonical
HookEvent. Adapters SHOULD be permissive about unknown fields
(clients evolve faster than we can ship adapter updates) and
strict only about the tiny subset they actually need. Read moreSource§fn format_output(&self, result: HookResult) -> String
fn format_output(&self, result: HookResult) -> String
Format a
HookResult as the exact JSON the client expects on
stdout. Returns a complete, newline-free string; the caller
prints it + a trailing newline. Formatting is infallible because
HookResult is a fixed shape we control.Source§fn classify_error(&self, err: &Error) -> ErrorClass
fn classify_error(&self, err: &Error) -> ErrorClass
Bucket an error produced by the hook’s core work so the CLI can
pick an exit code (see
main.rs Hook::Run). Default walks the
anyhow error chain for transport-ish hints (io kinds, reqwest
connect/timeout, HTTP 5xx) vs client-ish hints (HTTP 4xx, serde
parse failures). Adapters can override when their transport layer
carries richer context than the default sniffer can see.Auto Trait Implementations§
impl Freeze for CursorAdapter
impl RefUnwindSafe for CursorAdapter
impl Send for CursorAdapter
impl Sync for CursorAdapter
impl Unpin for CursorAdapter
impl UnsafeUnpin for CursorAdapter
impl UnwindSafe for CursorAdapter
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
Converts
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>
Converts
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