WIP: Add some documentation to WebSocket and Error. #79
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.
So as I have been figuring out from the source code how tungstenite works, I felt it would be silly to just let that disappear when my memory fades, so I wrote documentation, hoping it will also save others time.
This isn't polished:
read_message
,write_pending
andclose
should probably have an Errors section which lists all the possible outcomeswrite_pending
is a user facing method that does not usecheck_active
. I haven't really dug into what that really implies. It probably returnsOk(())
forever for clients, instead of returningConnectionClosed
. It should probably be looked into and docs updated.Error::AlreadyClosed
that claimed this would be returned when writing after receiving a Close message, since it was simply not true, but this error kind should probably be re-evaluated after discussion in Review closing the connection #77.I have no intention of polishing this, cause I have my own chores to do on my own libraries, but "Allow edits from maintainers" is on. Please use it.