Skip to main content

NativeSidecar

Struct NativeSidecar 

Source
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,

Source

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,

Source

pub fn new(bridge: B) -> Result<Self, SidecarError>

Source

pub fn with_config( bridge: B, config: NativeSidecarConfig, ) -> Result<Self, SidecarError>

Source

pub fn with_config_and_extensions( bridge: B, config: NativeSidecarConfig, extensions: Vec<Box<dyn Extension>>, ) -> Result<Self, SidecarError>

Source

pub fn sidecar_id(&self) -> &str

Source

pub fn with_bridge_mut<T>( &self, operation: impl FnOnce(&mut B) -> T, ) -> Result<T, SidecarError>

Source

pub fn set_sidecar_request_transport( &mut self, transport: Arc<dyn SidecarRequestTransport>, )

Source

pub fn register_extension( &mut self, extension: Box<dyn Extension>, ) -> Result<(), SidecarError>

Source

pub fn set_sidecar_request_handler<F>(&mut self, handler: F)

Source

pub fn set_wire_sidecar_request_handler<F>(&mut self, handler: F)

Source

pub fn dispatch_blocking( &mut self, request: RequestFrame, ) -> Result<DispatchResult, SidecarError>

Source

pub fn dispatch_wire_blocking( &mut self, request: RequestFrame, ) -> Result<WireDispatchResult, SidecarError>

Source

pub fn poll_event_blocking( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>

Source

pub fn poll_event_wire_blocking( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>

Source

pub fn close_session_blocking( &mut self, connection_id: &str, session_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>

Source

pub fn remove_connection_blocking( &mut self, connection_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>

Source

pub fn dispose_vm_internal_blocking( &mut self, connection_id: &str, session_id: &str, vm_id: &str, reason: DisposeReason, ) -> Result<Vec<EventFrame>, SidecarError>

Source

pub async fn dispatch( &mut self, request: RequestFrame, ) -> Result<DispatchResult, SidecarError>

Source

pub async fn dispatch_wire( &mut self, request: RequestFrame, ) -> Result<WireDispatchResult, SidecarError>

Source

pub async fn poll_event_wire( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>

Source

pub async fn poll_event( &mut self, ownership: &OwnershipScope, timeout: Duration, ) -> Result<Option<EventFrame>, SidecarError>

Source

pub async fn close_session( &mut self, connection_id: &str, session_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>

Source

pub async fn remove_connection( &mut self, connection_id: &str, ) -> Result<Vec<EventFrame>, SidecarError>

Source

pub fn queue_sidecar_request( &mut self, ownership: OwnershipScope, payload: SidecarRequestPayload, ) -> Result<RequestId, SidecarError>

Source

pub fn queue_wire_sidecar_request( &mut self, ownership: OwnershipScope, payload: SidecarRequestPayload, ) -> Result<RequestId, SidecarError>

Source

pub fn pop_sidecar_request(&mut self) -> Option<SidecarRequestFrame>

Source

pub fn pop_wire_sidecar_request( &mut self, ) -> Result<Option<SidecarRequestFrame>, SidecarError>

Source

pub fn accept_sidecar_response( &mut self, response: SidecarResponseFrame, ) -> Result<(), SidecarError>

Source

pub fn accept_wire_sidecar_response( &mut self, response: SidecarResponseFrame, ) -> Result<(), SidecarError>

Source

pub fn take_sidecar_response( &mut self, request_id: RequestId, ) -> Option<SidecarResponseFrame>

Source

pub fn take_wire_sidecar_response( &mut self, request_id: RequestId, ) -> Result<Option<SidecarResponseFrame>, SidecarError>

Trait Implementations§

Source§

impl<B> Debug for NativeSidecar<B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B> ExtensionHost for NativeSidecar<B>
where B: NativeSidecarBridge + Send + 'static, <B as BridgeTypes>::Error: Debug + Send + Sync + 'static,

Source§

fn spawn_process<'a>( &'a mut self, ownership: OwnershipScope, payload: ExecuteRequest, ) -> ExtensionFuture<'a, ProcessStartedResponse>

Source§

fn write_stdin<'a>( &'a mut self, ownership: OwnershipScope, payload: WriteStdinRequest, ) -> ExtensionFuture<'a, StdinWrittenResponse>

Source§

fn close_stdin<'a>( &'a mut self, ownership: OwnershipScope, payload: CloseStdinRequest, ) -> ExtensionFuture<'a, StdinClosedResponse>

Source§

fn kill_process<'a>( &'a mut self, ownership: OwnershipScope, payload: KillProcessRequest, ) -> ExtensionFuture<'a, ProcessKilledResponse>

Source§

fn poll_event<'a>( &'a mut self, ownership: OwnershipScope, timeout: Duration, ) -> ExtensionFuture<'a, Option<EventFrame>>

Source§

fn guest_filesystem_call<'a>( &'a mut self, ownership: OwnershipScope, payload: GuestFilesystemCallRequest, ) -> ExtensionFuture<'a, GuestFilesystemResultResponse>

Source§

fn bind_process_to_session<'a>( &'a mut self, ownership: OwnershipScope, namespace: String, ext_session_id: String, process_id: String, ) -> ExtensionFuture<'a, ()>

Source§

fn bind_vm_to_session<'a>( &'a mut self, ownership: OwnershipScope, namespace: String, ext_session_id: String, ) -> ExtensionFuture<'a, ()>

Source§

fn dispose_session_resources<'a>( &'a mut self, ownership: OwnershipScope, namespace: String, ext_session_id: String, ) -> ExtensionFuture<'a, Vec<EventFrame>>

Source§

fn start_buffering_process_output<'a>( &'a mut self, ownership: OwnershipScope, process_id: String, ) -> ExtensionFuture<'a, ()>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more