MCPcopy Create free account

hub / github.com/BonsaiDen/cobalt-rs / functions

Functions196 in github.com/BonsaiDen/cobalt-rs

↓ 73 callersMethodsend
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 callersMethodsocket
Returns a mutable reference to the server's underlying socket.
src/server.rs:171
↓ 43 callersMethodreceive_packet
Receives a incoming UDP packet.
src/shared/connection.rs:381
↓ 38 callersMethodsend_packet
Send a new outgoing UDP packet.
src/shared/connection.rs:488
↓ 32 callersMethodassert_sent
(&mut self, expected: Vec<(T, Vec<u8>)>)
src/test/mock_socket.rs:123
↓ 30 callersMethodmock_receive
(&mut self, packets: Vec<(T, Vec<u8>)>)
src/test/mock_socket.rs:97
↓ 24 callersMethodconnection
Returns a mutable reference to the specified client connection.
src/server.rs:151
↓ 18 callersMethodevents
Returns a drain iterator over all queued events from this connection.
src/shared/connection.rs:368
↓ 17 callersFunctioncreate_connection
(config: Option<Config>)
src/test/connection.rs:1118
↓ 12 callersMethodlisten
Binds the server to listen the specified address.
src/server.rs:199
↓ 12 callersMethodlocal_addr
(&self)
src/test/mock_socket.rs:85
↓ 12 callersMethodpeer_addr
Returns the socket address for the remote end of this connection.
src/shared/connection.rs:343
↓ 11 callersMethodaccept_receive
Accepts new incoming client connections from the server's underlying server and receives and returns messages from them.
src/server.rs:223
↓ 11 callersMethodid
Returns the id of the connection.
src/shared/connection.rs:311
↓ 9 callersFunctionclient_init
Helpers --------------------------------------------------------------------
src/test/client.rs:677
↓ 9 callersMethodreceive
Receives the next incoming message from the client's underlying connection.
src/client.rs:230
↓ 9 callersMethodupdate
(&mut self, rtt: u32, _: f32)
src/shared/binary_rate_limiter.rs:66
↓ 6 callersMethodassert_sent_none
(&mut self)
src/test/mock_socket.rs:112
↓ 6 callersMethodconnect
Establishes a connection with the server at the specified address.
src/client.rs:194
↓ 5 callersMethodreset
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 callersMethodclose
Closes the connection, no further packets will be received or send.
src/shared/connection.rs:646
↓ 4 callersMethodreset
(&mut self)
src/shared/stats.rs:26
↓ 4 callersMethodsend
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 callersMethodsent
(&mut self)
src/test/mock_socket.rs:103
↓ 4 callersMethodshutdown
Shuts down all of the server's client connections, clearing any state and freeing the server's socket.
src/server.rs:318
↓ 4 callersFunctionto_socket_addr
Helpers --------------------------------------------------------------------
src/test/mock_socket.rs:188
↓ 4 callersFunctionwrite_message
( queue: &mut VecDeque<Message>, packet: &mut Vec<u8>, available: usize, written: &mut usize
src/shared/message_queue.rs:413
↓ 3 callersFunctionmap_connection_events
Helpers --------------------------------------------------------------------
src/server.rs:409
↓ 3 callersMethodset_config
Overrides the collector's existing configuration.
src/shared/stats.rs:79
↓ 3 callersFunctiontime_since
(i: &Instant)
src/shared/binary_rate_limiter.rs:173
↓ 3 callersFunctionwrite_messages
( queue: &mut VecDeque<Message>, packet: &mut Vec<u8>, available: usize, written: &mut usize )
src/shared/message_queue.rs:402
↓ 2 callersMethodaverage
Returns the calculated averages from the last tick.
src/shared/stats.rs:109
↓ 2 callersMethodbegin_tick
(&mut self)
src/shared/ticker.rs:47
↓ 2 callersMethodcongested
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 callersMethodconnections
Returns a mutable reference to the servers client connections.
src/server.rs:166
↓ 2 callersMethoddisconnect
Drops the client's connection to the server, freeing the socket and clearing any state.
src/client.rs:336
↓ 2 callersMethodend_tick
(&mut self)
src/shared/ticker.rs:56
↓ 2 callersMethodlost_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 callersFunctionmessages_from_packet
(packet: &[u8])
src/shared/message_queue.rs:353
↓ 2 callersMethodreceived
Returns a consuming iterator over all received messages in the queue.
src/shared/message_queue.rs:148
↓ 2 callersFunctionseq_bit_index
(seq: u32, ack: u32)
src/shared/connection.rs:781
↓ 2 callersMethodset_bytes_received
Sets the number of bytes received for the current tick.
src/shared/stats.rs:96
↓ 2 callersMethodset_bytes_sent
Sets the number of bytes sent for the current tick.
src/shared/stats.rs:88
↓ 2 callersMethodtick
Steps the internal tick value used for average calculation.
src/shared/stats.rs:104
↓ 2 callersMethodtry_recv
(&mut self)
src/test/mock_socket.rs:61
↓ 1 callersMethodassert_sent_sorted
(&mut self, expected: Vec<(T, Vec<u8>)>, sort_by_addr: bool)
src/test/mock_socket.rs:127
↓ 1 callersFunctionclient_events
(client: &mut Client<MockSocket, BinaryRateLimiter, NoopPacketModifier>)
src/test/client.rs:703
↓ 1 callersMethodcmp
(&self, other: &Self)
src/test/mock_socket.rs:27
↓ 1 callersMethodcmp
Explicitly implement the trait so the queue becomes a min-heap instead of a max-heap.
src/shared/message_queue.rs:58
↓ 1 callersMethodcongested
(&self)
src/shared/binary_rate_limiter.rs:152
↓ 1 callersMethoddismiss
Clears the queue of received messages, dismissing any messages which have not been fetched via `MessageQueue::received()`.
src/shared/message_queue.rs:154
↓ 1 callersMethodfail_further_sends
(&mut self)
src/test/mock_socket.rs:93
↓ 1 callersMethodincoming
(&mut self, data: &[u8])
src/test/connection.rs:1045
↓ 1 callersMethodlocal_addr
Returns the local address that the client is sending from.
src/client.rs:151
↓ 1 callersFunctionmillis_from_duration
(d: Duration)
src/shared/binary_rate_limiter.rs:177
↓ 1 callersFunctionmoving_average
Static Helpers -------------------------------------------------------------
src/shared/connection.rs:776
↓ 1 callersFunctionnanos_from_duration
Helpers ---------------------------------------------------------------------
src/shared/ticker.rs:96
↓ 1 callersMethodopen
Returns whether the connection is currently accepting any incoming packets.
src/shared/connection.rs:295
↓ 1 callersFunctionorder_is_more_recent
Static Helpers -------------------------------------------------------------
src/shared/message_queue.rs:348
↓ 1 callersMethodoutgoing
(&mut self, data: &[u8])
src/test/connection.rs:1033
↓ 1 callersMethodpacket_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 callersMethodpeer_addr
Returns the address of the server the client is currently connected to.
src/client.rs:146
↓ 1 callersMethodreceive_connection_packet
Internal ---------------------------------------------------------------
src/server.rs:338
↓ 1 callersMethodreceive_ordered_message
(&mut self, m: Message)
src/shared/message_queue.rs:283
↓ 1 callersMethodreset
(&mut self)
src/shared/binary_rate_limiter.rs:162
↓ 1 callersMethodrtt
Returns the average roundtrip time for the connection.
src/shared/connection.rs:326
↓ 1 callersMethodsend_ack_required
Internal Helpers -------------------------------------------------------
src/shared/connection.rs:768
↓ 1 callersMethodsend_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 callersFunctionseq_is_more_recent
(a: u32, b: u32)
src/shared/connection.rs:790
↓ 1 callersFunctionseq_was_acked
(seq: u32, ack: u32, bitfield: u32)
src/shared/connection.rs:795
↓ 1 callersFunctionserver_events
Helpers --------------------------------------------------------------------
src/test/server.rs:730
↓ 1 callersMethodset_id
Overrides the id of the connection.
src/shared/connection.rs:316
↓ 1 callersMethodset_peer_addr
Sets the socket address of the remote peer of this connection.
src/shared/connection.rs:348
↓ 1 callersMethodshould_send
(&self )
src/shared/binary_rate_limiter.rs:156
↓ 1 callersMethodupdate_receive_state
(&mut self, packet: &[u8])
src/shared/connection.rs:653
↓ 1 callersMethodupdate_send_state
(&mut self)
src/shared/connection.rs:701
Methodbytes_received
Returns the number of bytes received over the last second.
src/server.rs:141
Methodbytes_received
Returns the number of bytes received over the last second.
src/client.rs:141
Methodbytes_sent
Returns the number of bytes sent over the last second.
src/server.rs:136
Methodbytes_sent
Returns the number of bytes sent over the last second.
src/client.rs:136
Methodconfig
Returns the server's current configuration.
src/server.rs:181
Methodconfig
Returns the client's current configuration.
src/client.rs:176
Methodconnection
Returns a mutable reference to underlying connection to the server.
src/client.rs:156
Functioncreate_connection_with_modifier
Helpers --------------------------------------------------------------------
src/test/connection.rs:1109
Methoddefault
()
src/shared/config.rs:97
Methoddefault
()
src/shared/stats.rs:33
Methodfmt
(&self, f: &mut fmt::Formatter)
src/shared/udp_socket.rs:79
Methodfmt
(&self, f: &mut fmt::Formatter)
src/traits/rate_limiter.rs:42
Methodfmt
(&self, f: &mut fmt::Formatter)
src/traits/packet_modifier.rs:44
Methodid_from_packet
Extracts a `ConnectionID` from packet with a valid protocol header. # Examples ``` use cobalt::{ BinaryRateLimiter, Connection, ConnectionID, Config
src/shared/connection.rs:281
Methodincoming
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
Methodlocal_addr
Returns the local address that the client is sending from.
src/server.rs:146
Methodlocal_addr
Returns the socket address of the underlying `net::UdpSocket`.
src/shared/udp_socket.rs:72
Methodlocal_addr
Returns the socket address for the local end of this connection.
src/shared/connection.rs:338
Functionmain
()
examples/server.rs:11
Functionmain
()
examples/client.rs:11
Functionmessages
Helpers --------------------------------------------------------------------
src/test/message_queue.rs:493
Methodnew
Creates a new server with the given configuration.
src/server.rs:116
Methodnew
Creates a new client with the given configuration.
src/client.rs:117
Methodnew
(addr: T, _: usize)
src/test/mock_socket.rs:51
next →1–100 of 196, ranked by callers