Skip to content

rework toad-msg module structure #235

Description

@cakekindel

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};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions