pub struct NativeSidecar<B> { /* private fields */ }Implementations§
Source§impl<B> NativeSidecar<B>where
B: NativeSidecarBridge + Send + 'static,
<B as BridgeTypes>::Error: Debug + Send + Sync + 'static,
impl<B> NativeSidecar<B>where
B: NativeSidecarBridge + Send + 'static,
<B as BridgeTypes>::Error: Debug + Send + Sync + 'static,
pub async fn pump_process_events( &mut self, ownership: &OwnershipScope, ) -> Result<bool, SidecarError>
Source§impl<B> NativeSidecar<B>where
B: NativeSidecarBridge + Send + 'static,
<B as BridgeTypes>::Error: Debug + Send + Sync + 'static,
impl<B> NativeSidecar<B>where
B: NativeSidecarBridge + Send + 'static,
<B as BridgeTypes>::Error: Debug + Send + Sync + 'static,
pub fn new(bridge: B) -> Result<Self, SidecarError>
pub fn with_config( bridge: B, config: NativeSidecarConfig, ) -> Result<Self, SidecarError>
pub fn with_config_and_extensions( bridge: B, config: NativeSidecarConfig, extensions: Vec<Box<dyn Extension>>, ) -> Result<Self, SidecarError>
pub fn sidecar_id(&self) -> &str
pub fn with_bridge_mut<T>( &self, operation: impl FnOnce(&mut B) -> T, ) -> Result<T, SidecarError>
pub fn set_sidecar_request_transport( &mut self, transport: Arc<dyn SidecarRequestTransport>, )
pub fn register_extension( &mut self, extension: Box<dyn Extension>, ) -> Result<(), SidecarError>
pub fn set_sidecar_request_handler<F>(&mut self, handler: F)where
F: Fn(SidecarRequestFrame) -> Result<SidecarResponsePayload, SidecarError> + Send + Sync + 'static,
pub fn set_wire_sidecar_request_handler<F>(&mut self, handler: F)where
F: Fn(SidecarRequestFrame) -> Result<SidecarResponseFrame, SidecarError> + Send + Sync + 'static,
pub fn dispatch_blocking( &mut self, request: RequestFrame, ) -> Result<DispatchResult, SidecarError>
pub fn dispatch_wire_blocking( &mut self, request: RequestFrame, ) -> Result<WireDispatchResult, SidecarError>
pub fn poll_event_blocking( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>
pub fn poll_event_wire_blocking( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>
pub fn close_session_blocking( &mut self, connection_id: &str, session_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>
pub fn remove_connection_blocking( &mut self, connection_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>
pub fn dispose_vm_internal_blocking( &mut self, connection_id: &str, session_id: &str, vm_id: &str, reason: DisposeReason, ) -> Result<Vec<EventFrame>, SidecarError>
pub async fn dispatch( &mut self, request: RequestFrame, ) -> Result<DispatchResult, SidecarError>
pub async fn dispatch_wire( &mut self, request: RequestFrame, ) -> Result<WireDispatchResult, SidecarError>
pub async fn poll_event_wire( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>
pub async fn poll_event( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>
pub async fn close_session( &mut self, connection_id: &str, session_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>
pub async fn remove_connection( &mut self, connection_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>
pub fn queue_sidecar_request( &mut self, ownership: OwnershipScope, payload: SidecarRequestPayload, ) -> Result<RequestId, SidecarError>
pub fn queue_wire_sidecar_request( &mut self, ownership: OwnershipScope, payload: SidecarRequestPayload, ) -> Result<RequestId, SidecarError>
pub fn pop_sidecar_request(&mut self) -> Option<SidecarRequestFrame>
pub fn pop_wire_sidecar_request( &mut self, ) -> Result<Option<SidecarRequestFrame>, SidecarError>
pub fn accept_sidecar_response( &mut self, response: SidecarResponseFrame, ) -> Result<(), SidecarError>
pub fn accept_wire_sidecar_response( &mut self, response: SidecarResponseFrame, ) -> Result<(), SidecarError>
pub fn take_sidecar_response( &mut self, request_id: RequestId, ) -> Option<SidecarResponseFrame>
pub fn take_wire_sidecar_response( &mut self, request_id: RequestId, ) -> Result<Option<SidecarResponseFrame>, SidecarError>
Trait Implementations§
Source§impl<B> Debug for NativeSidecar<B>
impl<B> Debug for NativeSidecar<B>
Source§impl<B> ExtensionHost for NativeSidecar<B>where
B: NativeSidecarBridge + Send + 'static,
<B as BridgeTypes>::Error: Debug + Send + Sync + 'static,
impl<B> ExtensionHost for NativeSidecar<B>where
B: NativeSidecarBridge + Send + 'static,
<B as BridgeTypes>::Error: Debug + Send + Sync + 'static,
fn spawn_process<'a>( &'a mut self, ownership: OwnershipScope, payload: ExecuteRequest, ) -> ExtensionFuture<'a, ProcessStartedResponse>
fn write_stdin<'a>( &'a mut self, ownership: OwnershipScope, payload: WriteStdinRequest, ) -> ExtensionFuture<'a, StdinWrittenResponse>
fn close_stdin<'a>( &'a mut self, ownership: OwnershipScope, payload: CloseStdinRequest, ) -> ExtensionFuture<'a, StdinClosedResponse>
fn kill_process<'a>( &'a mut self, ownership: OwnershipScope, payload: KillProcessRequest, ) -> ExtensionFuture<'a, ProcessKilledResponse>
fn poll_event<'a>( &'a mut self, ownership: OwnershipScope, timeout: Duration, ) -> ExtensionFuture<'a, Option<EventFrame>>
fn guest_filesystem_call<'a>( &'a mut self, ownership: OwnershipScope, payload: GuestFilesystemCallRequest, ) -> ExtensionFuture<'a, GuestFilesystemResultResponse>
fn bind_process_to_session<'a>( &'a mut self, ownership: OwnershipScope, namespace: String, ext_session_id: String, process_id: String, ) -> ExtensionFuture<'a, ()>
fn bind_vm_to_session<'a>( &'a mut self, ownership: OwnershipScope, namespace: String, ext_session_id: String, ) -> ExtensionFuture<'a, ()>
fn dispose_session_resources<'a>( &'a mut self, ownership: OwnershipScope, namespace: String, ext_session_id: String, ) -> ExtensionFuture<'a, Vec<EventFrame>>
fn start_buffering_process_output<'a>( &'a mut self, ownership: OwnershipScope, process_id: String, ) -> ExtensionFuture<'a, ()>
fn handoff_buffered_process_output<'a>( &'a mut self, ownership: OwnershipScope, namespace: String, ext_session_id: String, process_id: String, timeout: Duration, ) -> ExtensionFuture<'a, ExtensionBufferedProcessOutput>
Auto Trait Implementations§
impl<B> !RefUnwindSafe for NativeSidecar<B>
impl<B> !Send for NativeSidecar<B>
impl<B> !Sync for NativeSidecar<B>
impl<B> !UnwindSafe for NativeSidecar<B>
impl<B> Freeze for NativeSidecar<B>
impl<B> Unpin for NativeSidecar<B>
impl<B> UnsafeUnpin for NativeSidecar<B>
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> 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 moreCreates a shared type from an unshared type.