pub struct Channel {
pub machine: String,
/* private fields */
}Expand description
A command channel to one machine, joined on its relay session.
Fields§
§machine: StringThe machine’s ID.
Implementations§
Source§impl Channel
impl Channel
Sourcepub async fn open(
url: &str,
ca_cert: Option<&Path>,
session: SessionId,
token: String,
machine: String,
machine_key: Vec<u8>,
) -> Result<Self>
pub async fn open( url: &str, ca_cert: Option<&Path>, session: SessionId, token: String, machine: String, machine_key: Vec<u8>, ) -> Result<Self>
Joins relay session session with token on a fresh command channel
(url is the relay’s /frontend endpoint), for machine machine
whose public key is machine_key.
§Errors
When the relay cannot be reached or refuses the join.
Sourcepub async fn challenge(&mut self) -> Result<Challenge>
pub async fn challenge(&mut self) -> Result<Challenge>
Asks for a challenge, checked against the machine’s key.
§Errors
A lost channel, or a challenge the machine did not sign.
Sourcepub async fn send_sealed(
&mut self,
account: &AccountKeys,
nonce: &[u8],
sealed: Vec<u8>,
) -> Result<Outcome>
pub async fn send_sealed( &mut self, account: &AccountKeys, nonce: &[u8], sealed: Vec<u8>, ) -> Result<Outcome>
Sends a sealed command and waits for the machine’s answer: the
outcome opened with account, or the refusal.
§Errors
A lost channel, a refusal, or a reply that does not open.
Auto Trait Implementations§
impl !Freeze for Channel
impl !RefUnwindSafe for Channel
impl !Sync for Channel
impl !UnwindSafe for Channel
impl Forget for Channel
impl Move for Channel
impl Send for Channel
impl Unpin for Channel
impl UnsafeUnpin for Channel
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