Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes several changes to the
src/lib.rs
file, focusing on enhancing theListener
andStream
structs, as well as ensuring thread safety for multiple structs. The most important changes include implementingSync
andSend
traits for various structs, adding new methods to theListener
andStream
structs, and modifying existing methods for better functionality.Thread safety improvements:
Sync
andSend
traits forRegistration
,Configuration
,Connection
,Listener
, andStream
structs to ensure they can be safely shared across threads.Enhancements to
Listener
struct:Default
implementation for theListener
struct to provide a default instance.new
method of theListener
struct intonew
andopen
to allow us to pass itself as callback's context.stop
andget_local_addr
to theListener
struct to provide additional functionalities for stopping the listener and retrieving the local address.Enhancements to
Stream
struct:shutdown
method to theStream
struct to allow shutting down the stream with specific flags and error codes.get_param
andreceive_complete
to theStream
struct to retrieve parameters and mark the completion of data reception.Testing
NA
Documentation
TBD