pub struct DtnClient { /* private fields */ }
Expand description
Client for connecting to a local dtnd instance
Works with IPv6 and IPv4.
Implementations
sourceimpl DtnClient
impl DtnClient
sourcepub fn with_host_and_port(localhost: String, port: u16) -> Self
pub fn with_host_and_port(localhost: String, port: u16) -> Self
New client with custom host and port
sourcepub fn local_node_id(&self) -> Result<EndpointID, ClientError>
pub fn local_node_id(&self) -> Result<EndpointID, ClientError>
Return the local node ID via rest interface
sourcepub fn creation_timestamp(&self) -> Result<CreationTimestamp, ClientError>
pub fn creation_timestamp(&self) -> Result<CreationTimestamp, ClientError>
Get a new node-wide unique creation timestamp via rest interface
sourcepub fn register_application_endpoint(
&self,
path: &str
) -> Result<(), ClientError>
pub fn register_application_endpoint(
&self,
path: &str
) -> Result<(), ClientError>
Register a new application endpoint at local node
sourcepub fn unregister_application_endpoint(
&self,
path: &str
) -> Result<(), ClientError>
pub fn unregister_application_endpoint(
&self,
path: &str
) -> Result<(), ClientError>
Unregister an application endpoint at local node
sourcepub fn ws(&self) -> Result<DtnWsConnection<TcpStream>>
pub fn ws(&self) -> Result<DtnWsConnection<TcpStream>>
Constructs a new websocket connection to the configured dtn7 client
Trait Implementations
impl StructuralPartialEq for DtnClient
Auto Trait Implementations
impl RefUnwindSafe for DtnClient
impl Send for DtnClient
impl Sync for DtnClient
impl Unpin for DtnClient
impl UnwindSafe for DtnClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more