pub struct SyncthingRelayTransport {
pub relay_url: String,
pub session_key: [u8; 32],
/* private fields */
}Expand description
A length-delimited byte tunnel negotiated using Syncthing relay v1 messages.
The TLS/BEP authentication layer is intentionally left to the caller that owns Syncthing-compatible credentials; this type only handles the relay’s typed control messages and the subsequent byte tunnel.
Fields§
§relay_url: String§session_key: [u8; 32]Implementations§
Source§impl SyncthingRelayTransport
impl SyncthingRelayTransport
Sourcepub async fn connect(
relay_url_in: impl Into<String>,
device_id: DeviceId,
timeout_duration: Duration,
) -> Result<Self>
pub async fn connect( relay_url_in: impl Into<String>, device_id: DeviceId, timeout_duration: Duration, ) -> Result<Self>
§Errors
Returns an error if the connection to the relay fails.
Sourcepub async fn send_message(&self, message: &RelayMessage) -> Result<()>
pub async fn send_message(&self, message: &RelayMessage) -> Result<()>
§Errors
Returns an error if the relay message fails to send.
Sourcepub async fn recv_message(&self) -> Result<RelayMessage>
pub async fn recv_message(&self) -> Result<RelayMessage>
§Errors
Returns an error if receiving a relay message fails.
Auto Trait Implementations§
impl !Freeze for SyncthingRelayTransport
impl !RefUnwindSafe for SyncthingRelayTransport
impl Send for SyncthingRelayTransport
impl Sync for SyncthingRelayTransport
impl Unpin for SyncthingRelayTransport
impl UnsafeUnpin for SyncthingRelayTransport
impl UnwindSafe for SyncthingRelayTransport
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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