Struct buildsrs_builder::Connection
source · pub struct Connection { /* private fields */ }
Expand description
WebSocket
connection to receive jobs
Implementations§
source§impl Connection
impl Connection
sourcepub async fn connect(
strategy: DynStrategy,
private_key: PrivateKey,
url: &Url
) -> Result<Self>
pub async fn connect( strategy: DynStrategy, private_key: PrivateKey, url: &Url ) -> Result<Self>
Connect to WebSocket
endpoint.
sourcepub fn new(
strategy: DynStrategy,
websocket: WebSocketStream<MaybeTlsStream<TcpStream>>,
private_key: PrivateKey
) -> Self
pub fn new( strategy: DynStrategy, websocket: WebSocketStream<MaybeTlsStream<TcpStream>>, private_key: PrivateKey ) -> Self
Create new connection.
sourcepub async fn send(&mut self, message: ClientMessage) -> Result<()>
pub async fn send(&mut self, message: ClientMessage) -> Result<()>
Send a signed [ClientMessage
].
sourcepub async fn recv(
websocket: &mut WebSocketStream<MaybeTlsStream<TcpStream>>
) -> Result<ServerMessage>
pub async fn recv( websocket: &mut WebSocketStream<MaybeTlsStream<TcpStream>> ) -> Result<ServerMessage>
Receive a [ServerMessage
].
sourcepub async fn authenticate(&mut self) -> Result<()>
pub async fn authenticate(&mut self) -> Result<()>
Authenticate to server.
sourcepub async fn tasks_sync(&mut self) -> Result<()>
pub async fn tasks_sync(&mut self) -> Result<()>
Synchronize tasks with server.
sourcepub async fn handle_iter(&mut self) -> Result<()>
pub async fn handle_iter(&mut self) -> Result<()>
Handle a single iteration.
Auto Trait Implementations§
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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