Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/BonsaiDen/cobalt-rs
/ functions
Functions
196 in github.com/BonsaiDen/cobalt-rs
⨍
Functions
196
◇
Types & classes
28
↓ 73 callers
Method
send
Sends a message of the specified `kind` along with its `payload` over the connection. How exactly the message is send and whether it is guaranteed to
src/shared/connection.rs:363
↓ 45 callers
Method
socket
Returns a mutable reference to the server's underlying socket.
src/server.rs:171
↓ 43 callers
Method
receive_packet
Receives a incoming UDP packet.
src/shared/connection.rs:381
↓ 38 callers
Method
send_packet
Send a new outgoing UDP packet.
src/shared/connection.rs:488
↓ 32 callers
Method
assert_sent
(&mut self, expected: Vec<(T, Vec<u8>)>)
src/test/mock_socket.rs:123
↓ 30 callers
Method
mock_receive
(&mut self, packets: Vec<(T, Vec<u8>)>)
src/test/mock_socket.rs:97
↓ 24 callers
Method
connection
Returns a mutable reference to the specified client connection.
src/server.rs:151
↓ 18 callers
Method
events
Returns a drain iterator over all queued events from this connection.
src/shared/connection.rs:368
↓ 17 callers
Function
create_connection
(config: Option<Config>)
src/test/connection.rs:1118
↓ 12 callers
Method
listen
Binds the server to listen the specified address.
src/server.rs:199
↓ 12 callers
Method
local_addr
(&self)
src/test/mock_socket.rs:85
↓ 12 callers
Method
peer_addr
Returns the socket address for the remote end of this connection.
src/shared/connection.rs:343
↓ 11 callers
Method
accept_receive
Accepts new incoming client connections from the server's underlying server and receives and returns messages from them.
src/server.rs:223
↓ 11 callers
Method
id
Returns the id of the connection.
src/shared/connection.rs:311
↓ 9 callers
Function
client_init
Helpers --------------------------------------------------------------------
src/test/client.rs:677
↓ 9 callers
Method
receive
Receives the next incoming message from the client's underlying connection.
src/client.rs:230
↓ 9 callers
Method
update
(&mut self, rtt: u32, _: f32)
src/shared/binary_rate_limiter.rs:66
↓ 6 callers
Method
assert_sent_none
(&mut self)
src/test/mock_socket.rs:112
↓ 6 callers
Method
connect
Establishes a connection with the server at the specified address.
src/client.rs:194
↓ 5 callers
Method
reset
Resets the client, clearing all pending events and dropping any connection to the server, returning it into the `Connecting` state. This can be used
src/client.rs:320
↓ 4 callers
Method
close
Closes the connection, no further packets will be received or send.
src/shared/connection.rs:646
↓ 4 callers
Method
reset
(&mut self)
src/shared/stats.rs:26
↓ 4 callers
Method
send
Sends all queued messages to the server's underlying client connections. If `auto_tick` is specified as `true` this method will block the current thr
src/server.rs:267
↓ 4 callers
Method
sent
(&mut self)
src/test/mock_socket.rs:103
↓ 4 callers
Method
shutdown
Shuts down all of the server's client connections, clearing any state and freeing the server's socket.
src/server.rs:318
↓ 4 callers
Function
to_socket_addr
Helpers --------------------------------------------------------------------
src/test/mock_socket.rs:188
↓ 4 callers
Function
write_message
( queue: &mut VecDeque<Message>, packet: &mut Vec<u8>, available: usize, written: &mut usize
src/shared/message_queue.rs:413
↓ 3 callers
Function
map_connection_events
Helpers --------------------------------------------------------------------
src/server.rs:409
↓ 3 callers
Method
set_config
Overrides the collector's existing configuration.
src/shared/stats.rs:79
↓ 3 callers
Function
time_since
(i: &Instant)
src/shared/binary_rate_limiter.rs:173
↓ 3 callers
Function
write_messages
( queue: &mut VecDeque<Message>, packet: &mut Vec<u8>, available: usize, written: &mut usize )
src/shared/message_queue.rs:402
↓ 2 callers
Method
average
Returns the calculated averages from the last tick.
src/shared/stats.rs:109
↓ 2 callers
Method
begin_tick
(&mut self)
src/shared/ticker.rs:47
↓ 2 callers
Method
congested
Returns whether the connection is currently congested and should be sending less packets per second in order to resolve the congestion.
src/shared/connection.rs:306
↓ 2 callers
Method
connections
Returns a mutable reference to the servers client connections.
src/server.rs:166
↓ 2 callers
Method
disconnect
Drops the client's connection to the server, freeing the socket and clearing any state.
src/client.rs:336
↓ 2 callers
Method
end_tick
(&mut self)
src/shared/ticker.rs:56
↓ 2 callers
Method
lost_packet
Parses the contents of a lost packet into messages, dropping all messages of the type `MessageKind::Instant` and prepending all remaining valid messag
src/shared/message_queue.rs:257
↓ 2 callers
Function
messages_from_packet
(packet: &[u8])
src/shared/message_queue.rs:353
↓ 2 callers
Method
received
Returns a consuming iterator over all received messages in the queue.
src/shared/message_queue.rs:148
↓ 2 callers
Function
seq_bit_index
(seq: u32, ack: u32)
src/shared/connection.rs:781
↓ 2 callers
Method
set_bytes_received
Sets the number of bytes received for the current tick.
src/shared/stats.rs:96
↓ 2 callers
Method
set_bytes_sent
Sets the number of bytes sent for the current tick.
src/shared/stats.rs:88
↓ 2 callers
Method
tick
Steps the internal tick value used for average calculation.
src/shared/stats.rs:104
↓ 2 callers
Method
try_recv
(&mut self)
src/test/mock_socket.rs:61
↓ 1 callers
Method
assert_sent_sorted
(&mut self, expected: Vec<(T, Vec<u8>)>, sort_by_addr: bool)
src/test/mock_socket.rs:127
↓ 1 callers
Function
client_events
(client: &mut Client<MockSocket, BinaryRateLimiter, NoopPacketModifier>)
src/test/client.rs:703
↓ 1 callers
Method
cmp
(&self, other: &Self)
src/test/mock_socket.rs:27
↓ 1 callers
Method
cmp
Explicitly implement the trait so the queue becomes a min-heap instead of a max-heap.
src/shared/message_queue.rs:58
↓ 1 callers
Method
congested
(&self)
src/shared/binary_rate_limiter.rs:152
↓ 1 callers
Method
dismiss
Clears the queue of received messages, dismissing any messages which have not been fetched via `MessageQueue::received()`.
src/shared/message_queue.rs:154
↓ 1 callers
Method
fail_further_sends
(&mut self)
src/test/mock_socket.rs:93
↓ 1 callers
Method
incoming
(&mut self, data: &[u8])
src/test/connection.rs:1045
↓ 1 callers
Method
local_addr
Returns the local address that the client is sending from.
src/client.rs:151
↓ 1 callers
Function
millis_from_duration
(d: Duration)
src/shared/binary_rate_limiter.rs:177
↓ 1 callers
Function
moving_average
Static Helpers -------------------------------------------------------------
src/shared/connection.rs:776
↓ 1 callers
Function
nanos_from_duration
Helpers ---------------------------------------------------------------------
src/shared/ticker.rs:96
↓ 1 callers
Method
open
Returns whether the connection is currently accepting any incoming packets.
src/shared/connection.rs:295
↓ 1 callers
Function
order_is_more_recent
Static Helpers -------------------------------------------------------------
src/shared/message_queue.rs:348
↓ 1 callers
Method
outgoing
(&mut self, data: &[u8])
src/test/connection.rs:1033
↓ 1 callers
Method
packet_loss
Returns the percent of packets that were sent and never acknowledged over the total number of packets that have been send across the connection.
src/shared/connection.rs:333
↓ 1 callers
Method
peer_addr
Returns the address of the server the client is currently connected to.
src/client.rs:146
↓ 1 callers
Method
receive_connection_packet
Internal ---------------------------------------------------------------
src/server.rs:338
↓ 1 callers
Method
receive_ordered_message
(&mut self, m: Message)
src/shared/message_queue.rs:283
↓ 1 callers
Method
reset
(&mut self)
src/shared/binary_rate_limiter.rs:162
↓ 1 callers
Method
rtt
Returns the average roundtrip time for the connection.
src/shared/connection.rs:326
↓ 1 callers
Method
send_ack_required
Internal Helpers -------------------------------------------------------
src/shared/connection.rs:768
↓ 1 callers
Method
send_to
Send data on the socket to the given address. On success, returns the number of bytes written.
src/shared/udp_socket.rs:64
↓ 1 callers
Function
seq_is_more_recent
(a: u32, b: u32)
src/shared/connection.rs:790
↓ 1 callers
Function
seq_was_acked
(seq: u32, ack: u32, bitfield: u32)
src/shared/connection.rs:795
↓ 1 callers
Function
server_events
Helpers --------------------------------------------------------------------
src/test/server.rs:730
↓ 1 callers
Method
set_id
Overrides the id of the connection.
src/shared/connection.rs:316
↓ 1 callers
Method
set_peer_addr
Sets the socket address of the remote peer of this connection.
src/shared/connection.rs:348
↓ 1 callers
Method
should_send
(&self )
src/shared/binary_rate_limiter.rs:156
↓ 1 callers
Method
update_receive_state
(&mut self, packet: &[u8])
src/shared/connection.rs:653
↓ 1 callers
Method
update_send_state
(&mut self)
src/shared/connection.rs:701
Method
bytes_received
Returns the number of bytes received over the last second.
src/server.rs:141
Method
bytes_received
Returns the number of bytes received over the last second.
src/client.rs:141
Method
bytes_sent
Returns the number of bytes sent over the last second.
src/server.rs:136
Method
bytes_sent
Returns the number of bytes sent over the last second.
src/client.rs:136
Method
config
Returns the server's current configuration.
src/server.rs:181
Method
config
Returns the client's current configuration.
src/client.rs:176
Method
connection
Returns a mutable reference to underlying connection to the server.
src/client.rs:156
Function
create_connection_with_modifier
Helpers --------------------------------------------------------------------
src/test/connection.rs:1109
Method
default
()
src/shared/config.rs:97
Method
default
()
src/shared/stats.rs:33
Method
fmt
(&self, f: &mut fmt::Formatter)
src/shared/udp_socket.rs:79
Method
fmt
(&self, f: &mut fmt::Formatter)
src/traits/rate_limiter.rs:42
Method
fmt
(&self, f: &mut fmt::Formatter)
src/traits/packet_modifier.rs:44
Method
id_from_packet
Extracts a `ConnectionID` from packet with a valid protocol header. # Examples ``` use cobalt::{ BinaryRateLimiter, Connection, ConnectionID, Config
src/shared/connection.rs:281
Method
incoming
Method that is called for payload modification purposes after a packet is received over a connection's underlying socket. The default implementation
src/traits/packet_modifier.rs:37
Method
local_addr
Returns the local address that the client is sending from.
src/server.rs:146
Method
local_addr
Returns the socket address of the underlying `net::UdpSocket`.
src/shared/udp_socket.rs:72
Method
local_addr
Returns the socket address for the local end of this connection.
src/shared/connection.rs:338
Function
main
()
examples/server.rs:11
Function
main
()
examples/client.rs:11
Function
messages
Helpers --------------------------------------------------------------------
src/test/message_queue.rs:493
Method
new
Creates a new server with the given configuration.
src/server.rs:116
Method
new
Creates a new client with the given configuration.
src/client.rs:117
Method
new
(addr: T, _: usize)
src/test/mock_socket.rs:51
next →
1–100 of 196, ranked by callers