1#![cfg_attr(test, deny(warnings))]
2#![deny(missing_docs)]
3#![deny(missing_debug_implementations)]
4
5use std::fmt;
16use std::time::Duration;
17
18mod build;
19mod error;
20mod parse;
21mod util;
22
23pub use self::build::Builder;
24pub use self::error::Error;
25pub use self::parse::parse;
26pub use self::util::SameSite;
27
28use self::sealed::Sealed;
29
30pub trait Cookie: fmt::Debug + fmt::Display + Sealed {
32 fn name(&self) -> &str;
34
35 fn value(&self) -> &str;
37
38 fn domain(&self) -> Option<&str>;
40
41 fn path(&self) -> Option<&str>;
43
44 fn max_age(&self) -> Option<Duration>;
46
47 fn http_only(&self) -> bool;
49
50 fn secure(&self) -> bool;
52
53 fn same_site(&self) -> Option<SameSite>;
55}
56
57mod sealed {
58 pub trait Sealed {}
59}