MCPcopy Create free account

hub / github.com/Benestar/rust-chord / functions

Functions109 in github.com/Benestar/rust-chord

↓ 16 callersMethodidentifier
(&self)
src/routing/identifier.rs:155
↓ 16 callersFunctiontest_message_payload
(buf: &[u8], msg: T)
src/message/mod.rs:275
↓ 12 callersMethodsend
Sends a message to the remote peer. This operation is blocking until the message has been sent.
src/network.rs:98
↓ 7 callersMethodreceive
Receives a message from the remote peer. This operation is blocking until a message has been received.
src/network.rs:78
↓ 6 callersMethodparse
(mut reader: T)
src/message/mod.rs:99
↓ 6 callersMethodparse
(reader: &mut dyn Read)
src/message/p2p.rs:107
↓ 5 callersMethodas_bytes
Returns the raw bytes of this identifier. # Examples ``` # use chord::routing::identifier::Identifier; # let id = Identifier::new(&[5; 32]); assert
src/routing/identifier.rs:114
↓ 4 callersFunctionread_line
(question: &str)
src/bin/api.rs:51
↓ 3 callersMethodresponsible_for
(&self, identifier: Identifier)
src/handler/p2p.rs:33
↓ 3 callersMethodwrite_to
(&self, mut writer: T)
src/message/mod.rs:172
↓ 2 callersMethodfind_peer
Get the socket address of the peer responsible for a given identifier. This iteratively sends PEER FIND messages to successive peers, beginning with
src/procedures.rs:24
↓ 2 callersMethodfind_peer
(&self, identifier: Identifier)
src/handler/api.rs:40
↓ 2 callersMethodhandle_error
(&self, error: &dyn Error)
src/handler/p2p.rs:239
↓ 2 callersMethodis_between
Returns whether this identifier is between `first` and `second` on the identifier circle. The first identifier is excluded from the range while the s
src/routing/identifier.rs:76
↓ 2 callersMethodleading_zeros
Returns the binary logarithm of this identifier minus the given offset. The result is the floor of the actual result. # Examples ``` # use chord::r
src/routing/identifier.rs:99
↓ 2 callersMethodlisten
Listens on the given socket address. `num_workers` defines the number of worker threads which handle incoming requests in parallel.
src/network.rs:236
↓ 2 callersMethodnotify_predecessor
Notify the successor of a potential predecessor and asks to reply with the current predecessor. Opens a P2P connection and sends a PREDECESSOR NOTIFY
src/procedures.rs:137
↓ 2 callersMethodset_predecessor
Sets the predecessor's address.
src/routing/mod.rs:52
↓ 2 callersMethodset_successor
Sets the current successor.
src/routing/mod.rs:57
↓ 1 callersMethodbootstrap
Creates a new routing table by asking the bootstrap peer for all relevant information. This first finds the peer which is currently responsible for o
src/stabilization.rs:40
↓ 1 callersMethodclosest_peer
(&self, identifier: Identifier)
src/handler/p2p.rs:39
↓ 1 callersMethodclosest_peer
(&self, identifier: Identifier)
src/handler/api.rs:34
↓ 1 callersMethodfingers
Returns the number of fingers.
src/routing/mod.rs:74
↓ 1 callersMethodget_from_storage
(&self, key: Key)
src/handler/p2p.rs:78
↓ 1 callersMethodget_value
Send a storage get message to a peer with the objective to find a value for a given key. Opens a P2P connection to `peer_addr` and sends a STORAGE GE
src/procedures.rs:61
↓ 1 callersMethodhandle_connection
(&self, mut con: Connection)
src/handler/p2p.rs:223
↓ 1 callersMethodhandle_dht_get
(&self, mut api_con: Connection, dht_get: DhtGet)
src/handler/api.rs:46
↓ 1 callersMethodhandle_dht_put
(&self, _con: Connection, dht_put: DhtPut)
src/handler/api.rs:74
↓ 1 callersMethodhandle_error
(&self, error: &dyn Error)
src/handler/api.rs:103
↓ 1 callersFunctionhandle_get
(config: Config)
src/bin/api.rs:88
↓ 1 callersMethodhandle_incoming
Handles an incomming connection. Depending on the `result` this either calls [`handle_error`] or creates a new [`Connection`] from the given [`TcpStr
src/network.rs:174
↓ 1 callersMethodhandle_peer_find
(&self, mut con: Connection, peer_find: PeerFind)
src/handler/p2p.rs:180
↓ 1 callersMethodhandle_predecessor_notify
( &self, mut con: Connection, predecessor_notify: PredecessorNotify, )
src/handler/p2p.rs:200
↓ 1 callersFunctionhandle_put
(config: Config)
src/bin/api.rs:66
↓ 1 callersMethodhandle_storage_get
( &self, mut con: Connection, storage_get: StorageGet, )
src/handler/p2p.rs:96
↓ 1 callersMethodhandle_storage_put
( &self, mut con: Connection, storage_put: StoragePut, )
src/handler/p2p.rs:139
↓ 1 callersMethodnotify_predecessor
(&self, predecessor_addr: SocketAddr)
src/handler/p2p.rs:45
↓ 1 callersMethodput_to_storage
(&self, key: Key, value: Vec<u8>)
src/handler/p2p.rs:84
↓ 1 callersMethodput_value
Put a value for a given key into the distributed hash table. Opens a P2P connection to `peer_addr` and sends a STORAGE PUT message to store `value` u
src/procedures.rs:91
↓ 1 callersMethodresponsible_for
Checks whether this peer is responsible for the given identifier.
src/routing/mod.rs:79
↓ 1 callersFunctionrun
(config: Config, bootstrap: Option<SocketAddr>)
src/lib.rs:84
↓ 1 callersMethodset_finger
Sets the finger for the given index.
src/routing/mod.rs:69
↓ 1 callersMethodstabilize
Updates the successor and finger tables The current successor is asked for its predecessor. If the predecessor would be a closer successor than the f
src/stabilization.rs:83
↓ 1 callersMethodupdate_fingers
(&self)
src/stabilization.rs:126
↓ 1 callersMethodupdate_successor
(&self)
src/stabilization.rs:96
Methodadd
(self, other: Self)
src/routing/identifier.rs:123
Methodcause
(&self)
src/error.rs:59
Methodclosest_peer
Returns the peer closest to the given identifier.
src/routing/mod.rs:84
Methodderef
(&self)
src/routing/identifier.rs:225
Methoddescription
(&self)
src/error.rs:55
Functiondht_failure
()
src/message/api.rs:205
Functiondht_get
()
src/message/api.rs:172
Functiondht_put
()
src/message/api.rs:149
Functiondht_success
()
src/message/api.rs:186
Methodfmt
(&self, f: &mut fmt::Formatter)
src/error.rs:49
Methodfmt
(&self, f: &mut fmt::Formatter)
src/storage.rs:10
Methodfmt
(&self, f: &mut fmt::Formatter)
src/message/mod.rs:242
Methodfmt
(&self, f: &mut fmt::Formatter)
src/routing/identifier.rs:142
Methodfrom_stream
(stream: TcpStream)
src/network.rs:69
Methodgenerate
(bytes: &[u8])
src/routing/identifier.rs:51
Methodhandle_connection
(&self, mut con: Connection)
src/handler/api.rs:91
Functionidentifier_add
()
src/routing/identifier.rs:303
Functionidentifier_add_overflow
()
src/routing/identifier.rs:312
Functionidentifier_sub
()
src/routing/identifier.rs:321
Functionidentifier_sub_overflow
()
src/routing/identifier.rs:330
Functionidentifier_with_bit
()
src/routing/identifier.rs:235
Functionis_between
()
src/routing/identifier.rs:248
Functionis_between_edges
()
src/routing/identifier.rs:264
Functionleading_zeros
()
src/routing/identifier.rs:278
Functionleading_zeros_max
()
src/routing/identifier.rs:296
Functionleading_zeros_min
()
src/routing/identifier.rs:289
Methodload_from_file
(filename: P)
src/config.rs:16
Methodlocal_addr
Returns the socket address of the local half of this TCP connection. See [`TcpStream::local_addr`] for further documentation. [`TcpStream::local_add
src/network.rs:129
Functionmain
()
src/bin/dht.rs:42
Functionmain
()
src/bin/api.rs:27
Functionmessage_parse
()
src/message/mod.rs:289
Functionmessage_parse_empty_buffer
()
src/message/mod.rs:318
Functionmessage_parse_invalid_message_type
()
src/message/mod.rs:356
Functionmessage_parse_wrong_size
()
src/message/mod.rs:327
Functionmessage_parse_zero_size
()
src/message/mod.rs:342
Functionmessage_write_to
()
src/message/mod.rs:370
Methodnew
(timeout: u64)
src/procedures.rs:16
Methodnew
Initializes the bootstrap algorithm by providing the peer's own address, the address of a bootstrapping peer and the number of fingers that should be
src/stabilization.rs:26
Methodnew
Creates a new server for the given handler. The [`ServerHandler`] must also implement [`Send`] and [`Sync`] to ensure it can be shared between thread
src/network.rs:226
Methodnew
Creates a new message error from an existing message as well as an arbitrary error payload. # Examples ``` # use chord::error::MessageError; # use c
src/error.rs:43
Methodnew
Creates a new `Routing` instance for the given initial values.
src/routing/mod.rs:42
Methodnew
Creates a new identifier from a byte slice. This method does not perform any hashing but interprets the bytes as a raw identifier. # Panics Panics
src/routing/identifier.rs:38
Methodnew
Creates a new `P2PHandler` instance.
src/handler/p2p.rs:27
Methodnew
Creates a new `ApiHandler` instance.
src/handler/api.rs:25
Methodopen
Opens a TCP connection to a remote peer. This uses [`TcpStream::connect`] to create a new TCP socket to the remote peer with address `addr`. `timeou
src/network.rs:56
Methodparse
(reader: &mut dyn Read)
src/message/api.rs:62
Methodpeer_addr
Returns the socket address of the remote peer of this TCP connection. See [`TcpStream::peer_addr`] for further documentation. [`TcpStream::peer_addr
src/network.rs:119
Functionpeer_find
()
src/message/p2p.rs:439
Functionpeer_found_ipv4
()
src/message/p2p.rs:455
Functionpeer_found_ipv6
()
src/message/p2p.rs:476
Functionpredecessor_notify_ipv4
()
src/message/p2p.rs:497
Functionpredecessor_notify_ipv6
()
src/message/p2p.rs:514
Functionpredecessor_reply_ipv4
()
src/message/p2p.rs:531
Functionpredecessor_reply_ipv6
()
src/message/p2p.rs:548
Methodshutdown
Shuts down the read and write part of this connection. See [`TcpStream::shutdown`] for further documentation. [`TcpStream::shutdown`]: ../../std/net
src/network.rs:139
next →1–100 of 109, ranked by callers