Skip to content

Commit

Permalink
update imports in docs & tiny fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Engelhardt <[email protected]>
  • Loading branch information
antonengelhardt committed Apr 30, 2024
1 parent 2d9990a commit f190139
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub trait Context {
/// ```rust
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
///
/// use std::time::Duration;
/// use log::warn;
///
/// struct MyPlugin;
Expand All @@ -99,7 +99,7 @@ pub trait Context {
/// vec![],
/// Duration::from_secs(5),
/// ) {
/// Ok(_) => Action::Pause,
/// Ok(_) => Action::Continue,
/// Err(e) => {
/// warn!("Failed to dispatch_http_call: {:?}", e);
/// Action::Pause
Expand Down Expand Up @@ -150,7 +150,7 @@ pub trait Context {
/// ```rust
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
///
/// use std::time::Duration;
/// use log::{debug, warn};
///
/// struct MyPlugin;
Expand All @@ -167,7 +167,7 @@ pub trait Context {
/// vec![],
/// Duration::from_secs(5),
/// ) {
/// Ok(_) => Action::Pause,
/// Ok(_) => Action::Continue,
/// Err(e) => {
/// warn!("Failed to dispatch_http_call: {:?}", e);
/// Action::Pause
Expand Down Expand Up @@ -348,7 +348,10 @@ pub trait RootContext: Context {
/// # Example
///
/// ```rust
/// use proxy_wasm::traits::RootContext;
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
/// use serde_json;
/// use log::debug;
///
/// struct MyRootContext;
///
Expand Down Expand Up @@ -385,7 +388,10 @@ pub trait RootContext: Context {
/// # Example
///
/// ```rust
/// use proxy_wasm::traits::RootContext;
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
/// use serde_json;
/// use log::debug;
///
/// struct MyRootContext;
///
Expand Down Expand Up @@ -427,7 +433,10 @@ pub trait RootContext: Context {
/// # Example
///
/// ```rust
/// use proxy_wasm::traits::RootContext;
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
/// use serde_json;
/// use log::debug;
///
/// struct MyRootContext;
///
Expand All @@ -445,6 +454,7 @@ pub trait RootContext: Context {
/// let parsed_plugin_configuration: MyPluginConfiguration = serde_json::from_slice::<MyPluginConfiguration>(&plugin_configuration).unwrap();
///
/// // Do something with the parsed plugin configuration
/// debug!("plugin_configuration: {:?}", parsed_plugin_configuration)
///
/// true
/// }
Expand All @@ -463,7 +473,10 @@ pub trait RootContext: Context {
/// # Example
///
/// ```rust
/// use proxy_wasm::traits::RootContext;
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
/// use serde_json;
/// use log::debug;
///
/// struct MyRootContext;
///
Expand All @@ -481,6 +494,7 @@ pub trait RootContext: Context {
/// let parsed_plugin_configuration: MyPluginConfiguration = serde_json::from_slice::<MyPluginConfiguration>(&plugin_configuration).unwrap();
///
/// // Do something with the parsed plugin configuration
/// debug!("plugin_configuration: {:?}", parsed_plugin_configuration)
///
/// true
/// }
Expand All @@ -499,7 +513,8 @@ pub trait RootContext: Context {
/// # Example
///
/// ```rust
/// use proxy_wasm::traits::RootContext;
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
/// use std::time::Duration;
/// use log::info;
///
Expand Down Expand Up @@ -529,7 +544,8 @@ pub trait RootContext: Context {
/// # Example
///
/// ```rust
/// use proxy_wasm::traits::RootContext;
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::*;
/// use std::time::Duration;
/// use log::info;
///
Expand Down Expand Up @@ -723,9 +739,9 @@ pub trait HttpContext: Context {
/// # Example
///
/// ```rust
/// use log::debug;
/// use proxy_wasm::traits:*;
/// use proxy_wasm::types::Action;
/// use proxy_wasm::types::*;
/// use log::debug;
///
/// struct MyPlugin;
///
Expand Down Expand Up @@ -768,7 +784,7 @@ pub trait HttpContext: Context {
///
/// ```rust
/// use proxy_wasm::traits::*;
/// use proxy_wasm::types::Action;
/// use proxy_wasm::types::*;
///
/// struct MyPlugin;
///
Expand Down

0 comments on commit f190139

Please sign in to comment.