@@ -96,18 +96,18 @@ impl DataHash {
9696 }
9797}
9898
99- /// Bitmask enum representing features supported by the server.
99+ /// Bitmask enum representing capabilities supported by the server.
100100#[ bitmask( u64 ) ]
101101#[ bitmask_config( vec_debug) ]
102- pub enum ServerFeatures {
102+ pub enum Capabilities {
103103 /// Indicates support for preload checks.
104104 PreloadCheck = 0x1 ,
105105}
106106
107107/// Enum of messages sent from the client to the server.
108108#[ derive( Debug ) ]
109109pub enum ClientMessage {
110- /// Handshake message specifying supported protocol version range.
110+ /// Handshake message specifying the supported protocol version range.
111111 ClientHandshake { min_version : u8 , max_version : u8 } ,
112112
113113 /// Authentication message including client ID, secret, and IP address.
@@ -308,10 +308,11 @@ pub enum ServerMessage {
308308 /// Error response message.
309309 Error ( ErrorResponse ) ,
310310
311- /// Server handshake response with accepted protocol version and features.
311+ /// Server handshake response with the accepted protocol version and
312+ /// capabilities.
312313 ServerHandshake {
313314 accepted_version : u8 ,
314- features : ServerFeatures ,
315+ capabilities : Capabilities ,
315316 } ,
316317
317318 /// Authentication was accepted.
@@ -349,11 +350,11 @@ impl From<ServerMessage> for Message {
349350 ServerMessage :: Error ( error) => Message :: new ( 0x00 , vec ! [ error. into_error_code( ) ] ) ,
350351 ServerMessage :: ServerHandshake {
351352 accepted_version,
352- features ,
353+ capabilities ,
353354 } => {
354355 let mut payload = Vec :: with_capacity ( 9 ) ;
355356 payload. push ( accepted_version) ;
356- payload. extend_from_slice ( & features . bits ( ) . to_le_bytes ( ) ) ;
357+ payload. extend_from_slice ( & capabilities . bits ( ) . to_le_bytes ( ) ) ;
357358 Message :: new ( 0x02 , payload)
358359 }
359360 ServerMessage :: AuthenticationAccepted => Message :: new ( 0x04 , vec ! [ ] ) ,
@@ -620,10 +621,10 @@ mod tests {
620621
621622 #[ test]
622623 fn server_handshake_serializes_correctly ( ) {
623- let features = ServerFeatures :: none ( ) ;
624+ let features = Capabilities :: none ( ) ;
624625 let server_msg = ServerMessage :: ServerHandshake {
625626 accepted_version : 7 ,
626- features,
627+ capabilities : features,
627628 } ;
628629 let message: Message = server_msg. into ( ) ;
629630 assert_eq ! ( message. message_type, 0x02 ) ;
0 commit comments