pub struct SyncBridgeApiClient { /* private fields */ }Expand description
Synchronous bridge API client for simple use cases
Implementations§
Source§impl SyncBridgeApiClient
impl SyncBridgeApiClient
pub fn new( base_url: String, get_access_token: impl Fn() -> Option<String> + Send + Sync + 'static, runner_version: String, ) -> Self
pub fn with_trusted_device_token( self, getter: impl Fn() -> Option<String> + Send + Sync + 'static, ) -> Self
pub fn with_debug(self, debug: impl Fn(&str) + Send + Sync + 'static) -> Self
Sourcepub fn register_bridge_environment(
&self,
config: BridgeConfig,
) -> Result<RegistrationResponse, String>
pub fn register_bridge_environment( &self, config: BridgeConfig, ) -> Result<RegistrationResponse, String>
Register this bridge environment
Sourcepub fn poll_for_work(
&self,
environment_id: &str,
environment_secret: &str,
reclaim_older_than_ms: Option<u64>,
) -> Result<Option<WorkResponse>, String>
pub fn poll_for_work( &self, environment_id: &str, environment_secret: &str, reclaim_older_than_ms: Option<u64>, ) -> Result<Option<WorkResponse>, String>
Poll for work from the environment
Sourcepub fn acknowledge_work(
&self,
environment_id: &str,
work_id: &str,
session_token: &str,
) -> Result<(), String>
pub fn acknowledge_work( &self, environment_id: &str, work_id: &str, session_token: &str, ) -> Result<(), String>
Acknowledge work receipt
Sourcepub fn stop_work(
&self,
environment_id: &str,
work_id: &str,
force: bool,
) -> Result<(), String>
pub fn stop_work( &self, environment_id: &str, work_id: &str, force: bool, ) -> Result<(), String>
Stop a work item
Sourcepub fn deregister_environment(&self, environment_id: &str) -> Result<(), String>
pub fn deregister_environment(&self, environment_id: &str) -> Result<(), String>
Deregister the environment
Sourcepub fn reconnect_session(
&self,
environment_id: &str,
session_id: &str,
) -> Result<(), String>
pub fn reconnect_session( &self, environment_id: &str, session_id: &str, ) -> Result<(), String>
Reconnect a session
Sourcepub fn heartbeat_work(
&self,
environment_id: &str,
work_id: &str,
session_token: &str,
) -> Result<HeartbeatResponse, String>
pub fn heartbeat_work( &self, environment_id: &str, work_id: &str, session_token: &str, ) -> Result<HeartbeatResponse, String>
Send heartbeat for a work item
Sourcepub fn send_permission_response_event(
&self,
session_id: &str,
event: PermissionResponseEvent,
session_token: &str,
) -> Result<(), String>
pub fn send_permission_response_event( &self, session_id: &str, event: PermissionResponseEvent, session_token: &str, ) -> Result<(), String>
Send permission response event
Auto Trait Implementations§
impl Freeze for SyncBridgeApiClient
impl !RefUnwindSafe for SyncBridgeApiClient
impl Send for SyncBridgeApiClient
impl Sync for SyncBridgeApiClient
impl Unpin for SyncBridgeApiClient
impl UnsafeUnpin for SyncBridgeApiClient
impl !UnwindSafe for SyncBridgeApiClient
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