pub struct Link {
    pub private_id: Id,
    pub peer_id: PublicId,
    /* private fields */
}
Expand description

Represents a single reliable Link to another peer

Fields

private_id: Id

Identity of the user that created this identity

peer_id: PublicId

Public Identity of the other peer

Implementations

Creates a new Link to another peer

Arguments
  • id - Id of the user that is creating this link
  • socket - UDP socket used to communicate with the other peer
  • peer_addr - Address of the other peer
  • peer_id - Public Id of the other peer
  • send_seq - Sending Sequence number that the Link needs to be initialised with
  • recv_seq - Receiving Sequence number that the Link needs to be initialised with
  • config - Configuration for Aether

Starts the Link to the other peer

Stops the Link to the other peer

Get the SocketAddr of the peer

Sends bytes to the other peer

Arguments
  • buf - Buffer containing the bytes to be sent

Send a packet to the other peer

This alter’s the packet.sequence number of the packet argument. Rest of the packet is sent as it is

Arguments
  • packet - The Packet to be sent

Sets the read timeout for the Link

Arguments
  • timeout - Timeout for receiving packets from the other peer

Receive bytes from the other peer or return an error if the timeout is reached

Arguments
  • timeout - Timeout to wait for receiving packets
Returns
  • Vec<u8> - Buffer containing the received bytes
Errors

Other general errors might occur (refer to AetherError)

Receive bytes from the other peer

Returns
  • Vec<u8> - Buffer containing the received bytes
Errors

Other general errors might occur (refer to AetherError)

Returns a [Receiver] to receive packets from the output queue

Returns true if no more packets needs to be sent Checks if both primary queue and batch queue are empty

Waits and blocks the current thread until the Link is empty

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.