pub struct TcpLink { /* private fields */ }Expand description
A TCP stream presented as a ByteLink.
Implementations§
Source§impl TcpLink
impl TcpLink
Sourcepub async fn connect(addr: impl ToSocketAddrs) -> Result<Self>
pub async fn connect(addr: impl ToSocketAddrs) -> Result<Self>
Connects to a MAVLink TCP server, such as ArduPilot SITL on 127.0.0.1:5760.
Nagle’s algorithm is disabled so a frame is sent without waiting to coalesce, which keeps control latency low.
§Arguments
addr- the server address to connect to.
§Returns
The connected link.
§Errors
Returns an io::Error if the connection cannot be made.
Sourcepub fn from_stream(stream: TcpStream) -> Self
pub fn from_stream(stream: TcpStream) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TcpLink
impl RefUnwindSafe for TcpLink
impl Send for TcpLink
impl Sync for TcpLink
impl Unpin for TcpLink
impl UnsafeUnpin for TcpLink
impl UnwindSafe for TcpLink
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