pub struct ReplBridge {
pub session_id: RwLock<String>,
pub environment_id: RwLock<String>,
pub session_ingress_url: String,
pub inner: RwLock<Option<Arc<dyn ReplBridgeHandleInner>>>,
}Expand description
Main handle for interacting with the REPL bridge.
Fields§
§session_id: RwLock<String>The bridge session ID.
environment_id: RwLock<String>The environment ID.
session_ingress_url: StringThe session ingress URL.
inner: RwLock<Option<Arc<dyn ReplBridgeHandleInner>>>Internal handle (if using env-less v2).
Implementations§
Source§impl ReplBridge
impl ReplBridge
Sourcepub fn new(
session_id: String,
environment_id: String,
session_ingress_url: String,
) -> Self
pub fn new( session_id: String, environment_id: String, session_ingress_url: String, ) -> Self
Create a new REPL bridge.
Sourcepub async fn bridge_session_id(&self) -> String
pub async fn bridge_session_id(&self) -> String
Get the bridge session ID.
Sourcepub async fn environment_id(&self) -> String
pub async fn environment_id(&self) -> String
Get the environment ID.
Sourcepub fn session_ingress_url(&self) -> &str
pub fn session_ingress_url(&self) -> &str
Get the session ingress URL.
Sourcepub fn write_messages(&self, messages: Vec<SDKMessage>)
pub fn write_messages(&self, messages: Vec<SDKMessage>)
Write messages to the bridge.
Sourcepub fn write_sdk_messages(&self, messages: Vec<SDKMessage>)
pub fn write_sdk_messages(&self, messages: Vec<SDKMessage>)
Write SDK messages directly to the bridge.
Sourcepub fn send_control_request(&self, request: BridgeControlRequest)
pub fn send_control_request(&self, request: BridgeControlRequest)
Send a control request.
Sourcepub fn send_control_response(&self, response: BridgeControlResponse)
pub fn send_control_response(&self, response: BridgeControlResponse)
Send a control response.
Sourcepub fn send_control_cancel_request(&self, request_id: &str)
pub fn send_control_cancel_request(&self, request_id: &str)
Send a control cancel request.
Sourcepub fn send_result(&self)
pub fn send_result(&self)
Send a result message.
Auto Trait Implementations§
impl !Freeze for ReplBridge
impl !RefUnwindSafe for ReplBridge
impl Send for ReplBridge
impl Sync for ReplBridge
impl Unpin for ReplBridge
impl UnsafeUnpin for ReplBridge
impl !UnwindSafe for ReplBridge
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