Module Mavryk_p2p.P2p_peer_state

type ('conn, 'conn_meta) t =
  1. | Accepted of {
    1. current_point : Mavryk_base.TzPervasives.P2p_connection.Id.t;
    2. cancel : Lwt_canceler.t;
    }
    (*

    We accepted a incoming connection, we greeted back and we are waiting for an acknowledgment.

    *)
  2. | Running of {
    1. data : 'conn;
    2. conn_metadata : 'conn_meta;
    3. current_point : Mavryk_base.TzPervasives.P2p_connection.Id.t;
    }
    (*

    Successfully authenticated connection, normal business.

    *)
  3. | Disconnected
    (*

    No connection established currently.

    *)
type ('conn, 'conn_meta) state = ('conn, 'conn_meta) t
val pp : Stdlib.Format.formatter -> ('conn, 'conn_meta) t -> unit
module Info : sig ... end
val get : ('conn, 'peer_meta, 'conn_meta) Info.t -> ('conn, 'conn_meta) state
val is_disconnected : ('conn, 'peer_meta, 'conn_meta) Info.t -> bool
val is_accepted : ('conn, 'peer_meta, 'conn_meta) Info.t -> bool
val is_running : ('conn, 'peer_meta, 'conn_meta) Info.t -> bool
val set_accepted : timestamp:Mavryk_base.TzPervasives.Time.System.t -> ('conn, 'peer_meta, 'conn_meta) Info.t -> Mavryk_base.TzPervasives.P2p_connection.Id.t -> Lwt_canceler.t -> unit
val set_running : timestamp:Mavryk_base.TzPervasives.Time.System.t -> ('conn, 'peer_meta, 'conn_meta) Info.t -> Mavryk_base.TzPervasives.P2p_connection.Id.t -> 'conn -> 'conn_meta -> unit
val set_disconnected : timestamp:Mavryk_base.TzPervasives.Time.System.t -> ?requested:bool -> ('conn, 'peer_meta, 'conn_meta) Info.t -> unit