Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework toad-msg module structure #235

Open
cakekindel opened this issue Mar 6, 2023 · 0 comments
Open

rework toad-msg module structure #235

cakekindel opened this issue Mar 6, 2023 · 0 comments

Comments

@cakekindel
Copy link
Collaborator

cakekindel commented Mar 6, 2023

toad-msg could use a little white-gloving WRT the module and file structure, it's gotten a bit messy.

public api:

- struct Message
- struct Code
- struct Token
- struct Id
- struct Ver
- struct Type
- struct Opt
- struct OptIter
- struct OptRef
- struct OptRefIter
- enum SetError (prev. SetOptionError)
- enum MessageFromBytesError (prev. MessageParseError)
- enum OptionFromBytesError (prev. OptParseError)
- trait KnownOptions (prev. MessageOptions)
- trait TryIntoBytes
- trait TryFromBytes
- mod opt
  - struct Num (prev. OptNumber)
  - struct Val (prev. OptValue)
  - enum Importance
    - Critical
    - Elective
  - enum CacheKey
    - Include
    - Omit
  - enum ForwardSafety
    - Safe
    - Unsafe
  - enum ContentFormat
  - enum ObserveAction
  - trait Map (prev. OptionMap)
  - const ACCEPT, CONTENT_FORMAT, HOST...

private:

- mod msg
  - struct Message
  - struct Code
  - struct Token
  - struct Id
  - struct Ver
  - struct Type
  - enum SetError
- mod bytes
  - enum MessageFromBytesError (prev. MessageParseError)
  - enum OptionFromBytesError (prev. OptParseError)
  - trait TryIntoBytes
  - trait TryFromBytes
- mod opt
  - struct Opt
  - struct OptIter
  - struct OptRef
  - struct OptRefIter
  - enum Importance
    - Critical
    - Elective
  - enum CacheKey
    - Include
    - Omit
  - enum ForwardSafety
    - Safe
    - Unsafe
  - trait KnownOptions (prev. MessageOptions)
  - trait Map (prev. OptionMap)
  - mod num
    - struct Num (prev. OptNumber)
    - const ACCEPT, CONTENT_FORMAT, HOST...
  - mod val
    - struct Val (prev. OptValue)
    - enum ContentFormat
    - enum ObserveAction
// in toad-msg/src/lib.rs
#[doc(inline)] pub use msg::{Message, Code, Token, Id, Ver, Type, SetError};
#[doc(inline)] pub use opt::{Opt, OptRef, OptIter, OptRefIter, KnownOptions};
#[doc(inline)] pub use bytes::{TryFromBytes, TryIntoBytes, MessageFromBytesError, OptionFromBytesError};

// in toad-msg/src/opt/mod.rs
#[doc(inline)] pub use num::{Num, ACCEPT, CONTENT_FORMAT, ...};
#[doc(inline)] pub use val::{Val, ContentFormat, ObserveAction};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant