Skip to content

Commit

Permalink
Add Path extractor
Browse files Browse the repository at this point in the history
The extractor implementation is based on the [Axum path extractor](https://github.com/tokio-rs/axum/tree/main/axum/src/extract/path)

Change-type: minor
  • Loading branch information
pipex committed Nov 5, 2024
1 parent 51f745b commit 3402232
Show file tree
Hide file tree
Showing 7 changed files with 1,281 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ use serde::{Deserialize, Serialize};
use std::collections::HashMap;

// The state model
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone)]
struct State {
counters: HashMap<String, i32>,
}
Expand Down
3 changes: 3 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ pub enum Error {
#[error(transparent)]
SerializationError(#[from] serde_json::error::Error),

#[error(transparent)]
FailedToDeserializePathParams(#[from] super::extract::PathDeserializationError),

#[error(transparent)]
PatchFailed(#[from] json_patch::PatchError),

Expand Down
2 changes: 2 additions & 0 deletions src/extract/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
mod path;
mod target;
mod view;

pub use path::*;
pub use target::*;
pub use view::*;
Loading

0 comments on commit 3402232

Please sign in to comment.