strong/
lib.rs

1#[cfg(feature = "diesel")]
2#[macro_use]
3extern crate diesel;
4
5mod buf;
6mod impl_convert;
7mod slice;
8pub use buf::StrongBuf;
9pub use slice::Strong;
10
11/// Has marker traits for [`Validator`].
12pub mod marker;
13
14/// Requires `some_validators` feature.
15#[cfg(feature = "some_validators")]
16pub mod validators;
17
18/// Requires `diesel` feature.
19#[cfg(feature = "diesel")]
20pub mod impl_diesel;
21#[cfg(feature = "serde")]
22mod impl_serde;
23
24/// For [`Strong`]
25pub trait Validator {
26    type Err;
27    #[allow(unused_variables)]
28    #[inline]
29    fn validate(raw: &str) -> Result<(), Self::Err> { Ok(()) }
30}
31
32#[cfg(feature = "shorthand")]
33pub use Strong as S;
34#[cfg(feature = "shorthand")]
35pub use StrongBuf as Str;