Skip to content

Commit

Permalink
Make hooks module private and relevant types
Browse files Browse the repository at this point in the history
  • Loading branch information
bikeshedder committed Oct 18, 2021
1 parent 2c6f899 commit f35ac2a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/managed/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<M: Manager> HookVec<M> {
/// Collection of all the hooks that can be configured for a [`Pool`].
///
/// [`Pool`]: super::Pool
pub struct Hooks<M: Manager> {
pub(crate) struct Hooks<M: Manager> {
pub(crate) post_create: HookVec<M>,
pub(crate) pre_recycle: HookVec<M>,
pub(crate) post_recycle: HookVec<M>,
Expand Down
3 changes: 2 additions & 1 deletion src/managed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ mod builder;
mod config;
mod dropguard;
mod errors;
pub mod hooks;
mod hooks;
mod metrics;
pub mod reexports;
pub mod sync;
Expand All @@ -77,6 +77,7 @@ use tokio::sync::{Semaphore, TryAcquireError};

use crate::runtime::Runtime;

pub use hooks::{Hook, HookError, HookErrorCause};
pub use metrics::Metrics;

pub use crate::Status;
Expand Down
6 changes: 5 additions & 1 deletion src/managed/reexports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
//! ```

pub use crate::{
managed::{PoolConfig, Timeouts},
managed::{
hooks::{Hook, HookError, HookErrorCause},
metrics::Metrics,
PoolConfig, Timeouts,
},
Runtime,
};
5 changes: 1 addition & 4 deletions tests/managed_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};

use async_trait::async_trait;

use deadpool::managed::{
hooks::{Hook, HookError, HookErrorCause},
Manager, Pool, PoolError, RecycleResult,
};
use deadpool::managed::{Hook, HookError, HookErrorCause, Manager, Pool, PoolError, RecycleResult};

struct Computer {
next_id: AtomicUsize,
Expand Down

0 comments on commit f35ac2a

Please sign in to comment.