rama::net

Module client

Expand description

generic client net logic

Structs§

  • Storage for connection pool that uses FIFO to reuse open connections and LRU to drop/replace connections when the pool is at max capacity.
  • The established connection to a server returned for the http client to be used.
  • LeasedConnection is a connection that is temporarily leased from a pool and that will be returned to the pool once dropped if user didn’t take ownership of the connection C with [LeasedConnection::conn_to_owned()]. LeasedConnections are considered active pool connections until dropped or ownership is taken of the internal connection.
  • Connection pool which can be used to store and reuse existing connection. This struct can be copied and passed around as needed
  • PooledConnector is a connector that will keep connections around in a local pool so they can be reused later. If no connections are available for a specifc id it will create a new one.

Traits§

  • Glue trait that is used as the Connector trait bound for clients establishing a connection on one layer or another.
  • PoolStorage implements the storage part of a connection pool. This storage also decides which connection it returns for a given ID or when the caller asks to remove one, this results in the storage deciding which mode we use for connection reuse and dropping (eg FIFO for reuse and LRU for dropping conn when pool is full)
  • ReqToConnID is used to convert a Request to a connection ID. These IDs are not unique and multiple connections can have the same ID. IDs are used to filter which connections can be used for a specific Request in a way that is indepent of what a Request is.