Skip to content

Commit

Permalink
Add standard Rust attributes. (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
  • Loading branch information
yskopets authored Jul 1, 2021
1 parent 32a71e6 commit edb5cd5
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub type NewStreamContext = fn(context_id: u32, root_context_id: u32) -> Box<dyn
pub type NewHttpContext = fn(context_id: u32, root_context_id: u32) -> Box<dyn HttpContext>;

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub enum LogLevel {
Trace = 0,
Debug = 1,
Expand All @@ -30,14 +30,16 @@ pub enum LogLevel {
}

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
pub enum Action {
Continue = 0,
Pause = 1,
}

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
pub enum Status {
Ok = 0,
NotFound = 1,
Expand All @@ -49,14 +51,16 @@ pub enum Status {
}

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
pub enum ContextType {
HttpContext = 0,
StreamContext = 1,
}

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
pub enum BufferType {
HttpRequestBody = 0,
HttpResponseBody = 1,
Expand All @@ -67,7 +71,8 @@ pub enum BufferType {
}

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
pub enum MapType {
HttpRequestHeaders = 0,
HttpRequestTrailers = 1,
Expand All @@ -80,15 +85,17 @@ pub enum MapType {
}

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
pub enum PeerType {
Unknown = 0,
Local = 1,
Remote = 2,
}

#[repr(u32)]
#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
pub enum MetricType {
Counter = 0,
Gauge = 1,
Expand Down

0 comments on commit edb5cd5

Please sign in to comment.