pub struct Server {Show 14 fields
key: PublicKey,
conf: Arc<Config>,
role: Role,
msgid: MsgId,
lower_bound: Slot,
parties: HashMap<PublicKey, Party>,
ibound: UnboundedSender<(PublicKey, Bytes, Option<OwnedSemaphorePermit>)>,
obound: UnboundedReceiver<Command>,
next_slot: Receiver<Slot>,
accept_tasks: JoinSet<Result<Connection, NetworkError>>,
hello_tasks: JoinMap<PublicKey, Result<(Hello, Connection, Hello), NetworkError>>,
connect_tasks: JoinMap<PublicKey, Connection>,
peer_tasks: JoinMap<PublicKey, Peer>,
metrics: Arc<dyn Metrics>,
}Fields§
§key: PublicKey§conf: Arc<Config>§role: Role§msgid: MsgId§lower_bound: Slot§parties: HashMap<PublicKey, Party>§ibound: UnboundedSender<(PublicKey, Bytes, Option<OwnedSemaphorePermit>)>§obound: UnboundedReceiver<Command>§next_slot: Receiver<Slot>§accept_tasks: JoinSet<Result<Connection, NetworkError>>§hello_tasks: JoinMap<PublicKey, Result<(Hello, Connection, Hello), NetworkError>>§connect_tasks: JoinMap<PublicKey, Connection>§peer_tasks: JoinMap<PublicKey, Peer>§metrics: Arc<dyn Metrics>Implementations§
Source§impl Server
impl Server
pub(super) fn spawn( conf: Arc<Config>, listener: TcpListener, role: Role, tx: UnboundedSender<(PublicKey, Bytes, Option<OwnedSemaphorePermit>)>, rx: UnboundedReceiver<Command>, sx: Receiver<Slot>, metrics: Arc<dyn Metrics>, ) -> JoinHandle<()>
async fn run(self, listener: TcpListener)
fn spawn_connect(&mut self, key: PublicKey, addr: NetAddr)
fn spawn_accept(&mut self, stream: TcpStream)
fn spawn_hello(&mut self, conn: Connection, ours: Hello)
fn spawn_peer(&mut self, key: PublicKey, peer: Peer)
fn next_msgid(&mut self) -> MsgId
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl !UnwindSafe for Server
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