Skip to main content

docan_rs/
lib.rs

1mod error;
2pub use error::*;
3mod constants;
4pub use constants::*;
5
6#[cfg(feature = "client")]
7mod client;
8#[cfg(feature = "client")]
9pub use client::*;
10#[cfg(feature = "server")]
11mod server;
12#[cfg(feature = "server")]
13pub use server::*;
14
15pub type DoCanResult<R> = Result<R, DoCanError>;
16/// SecurityAlgo
17///
18/// # Params
19///
20/// #1 level of security
21///
22/// #2 seed
23///
24/// #3 salt or other params
25///
26/// # Return
27///
28/// if all seed is 0x00, return None
29/// else all seed is not 0xFF return algo data,
30/// otherwise return Error
31pub type SecurityAlgo = fn(u8, &[u8], &[u8]) -> DoCanResult<Option<Vec<u8>>>;