pub struct SidecarTransport { /* private fields */ }Expand description
Owns the spawned sidecar child, the framed BARE stdio I/O tasks, the pending-response map, the event fan-out, and the callback dispatch table.
Implementations§
Source§impl SidecarTransport
impl SidecarTransport
Sourcepub async fn spawn(
binary_path: Option<String>,
) -> Result<Arc<Self>, TransportError>
pub async fn spawn( binary_path: Option<String>, ) -> Result<Arc<Self>, TransportError>
Spawn the native sidecar binary and start the stdio I/O tasks.
Does NOT run the handshake. Product clients drive Authenticate and any follow-up setup using
request_wire once the transport is live.
Sourcepub fn next_request_id(&self) -> RequestId
pub fn next_request_id(&self) -> RequestId
Allocate the next positive host request id.
Sourcepub async fn request_wire(
&self,
ownership: OwnershipScope,
payload: RequestPayload,
) -> Result<ResponsePayload, TransportError>
pub async fn request_wire( &self, ownership: OwnershipScope, payload: RequestPayload, ) -> Result<ResponsePayload, TransportError>
Issue a host request using generated wire protocol types and await a generated response.
Sourcepub async fn request_wire_bounded(
&self,
ownership: OwnershipScope,
payload: RequestPayload,
max_frame_bytes: usize,
) -> Result<ResponsePayload, TransportError>
pub async fn request_wire_bounded( &self, ownership: OwnershipScope, payload: RequestPayload, max_frame_bytes: usize, ) -> Result<ResponsePayload, TransportError>
Issue a host request using generated wire protocol types with a caller-specific frame limit.
Sourcepub fn subscribe_wire_events(&self) -> Receiver<(OwnershipScope, EventPayload)>
pub fn subscribe_wire_events(&self) -> Receiver<(OwnershipScope, EventPayload)>
Subscribe to structured/lifecycle/process events using generated wire protocol types.
Sourcepub fn register_wire_callback(
&self,
key: &'static str,
callback: WireSidecarCallback,
)
pub fn register_wire_callback( &self, key: &'static str, callback: WireSidecarCallback, )
Register a callback that answers a class of sidecar-initiated requests using generated wire protocol types.
Sourcepub fn max_frame_bytes(&self) -> usize
pub fn max_frame_bytes(&self) -> usize
Return the currently negotiated max frame size.
Sourcepub fn set_max_frame_bytes(&self, max_frame_bytes: usize)
pub fn set_max_frame_bytes(&self, max_frame_bytes: usize)
Update the negotiated max frame size after authentication.
Sourcepub fn kill_child(&self)
pub fn kill_child(&self)
Kill the child sidecar process if this transport still owns one.
Auto Trait Implementations§
impl !Freeze for SidecarTransport
impl !RefUnwindSafe for SidecarTransport
impl !UnwindSafe for SidecarTransport
impl Send for SidecarTransport
impl Sync for SidecarTransport
impl Unpin for SidecarTransport
impl UnsafeUnpin for SidecarTransport
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
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