Skip to main content

Crate lightyear_link

Crate lightyear_link 

Source
Expand description

Transport-agnostic link buffers and link lifecycle markers.

A Link is Lightyear’s transport-neutral boundary between higher-level networking systems and concrete IO backends. Protocol, connection, replication, and message systems read from and write to Link buffers; transport crates such as lightyear_udp, lightyear_webtransport, lightyear_websocket, lightyear_steam, and lightyear_crossbeam are responsible for moving those bytes::Bytes payloads across an actual network or in-process channel.

The crate deliberately keeps the IO abstraction narrow:

  • RecvPayload and SendPayload are opaque byte payloads.
  • LinkReceiver buffers payloads received from a transport until higher-level systems consume them.
  • LinkSender buffers payloads produced by higher-level systems until a transport flushes them.
  • LinkConditioner can delay or drop inbound payloads to simulate imperfect networks.
  • Linking, Linked, and Unlinked are mutually exclusive ECS marker components that keep Link::state synchronized with the entity lifecycle.

Server-side fan-out relationships live in server.

Modules§

prelude
server
Server-side link relationships.

Structs§

Link
Transport-neutral byte stream between two peers.
LinkConditioner
Generic receive-side packet conditioner.
LinkPlugin
Bevy plugin that installs link lifecycle and receive-buffer systems.
LinkReceiver
Receive-side payload queue for a Link.
LinkSender
Send-side payload queue for a Link.
LinkStart
Entity event requesting that a transport start establishing a Link.
LinkStats
Transport-observed statistics for a Link.
Linked
Marker component for an established link.
Linking
Marker component for a link whose transport connection is being established.
Unlink
Entity event requesting that a transport terminate a Link.
Unlinked
Marker component for a link that is not connected.

Enums§

LinkReceiveSystems
System sets that make up LinkSystems::Receive.
LinkState
Current lifecycle state of a Link.
LinkSystems
System sets for Link-related operations.

Type Aliases§

LinkReceiveSetDeprecated
Deprecated alias for LinkReceiveSystems.
LinkSetDeprecated
Deprecated alias for LinkSystems.
RecvLinkConditioner
Packet conditioner used for inbound RecvPayload values.
RecvPayload
Opaque byte payload received from a transport.
SendPayload
Opaque byte payload queued for a transport to send.