matrix_http_rendezvous/
lib.rs

1// Copyright 2022 The Matrix.org Foundation C.I.C.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![forbid(unsafe_code)]
16#![deny(clippy::all)]
17#![warn(clippy::pedantic)]
18
19use std::time::Duration;
20
21mod handlers;
22mod sessions;
23#[cfg(test)]
24mod tests;
25
26/// Default TTL of entries
27pub const DEFAULT_TTL: Duration = Duration::from_secs(60);
28
29/// Default max number of entries
30pub const DEFAULT_MAX_ENTRIES: usize = 10_000;
31
32/// Default max size of each entry
33pub const DEFAULT_MAX_BYTES: usize = 4 * 1024;
34
35#[doc(hidden)]
36pub const DEFAULT_MAX_BYTES_STR: &str = "4KiB";
37
38pub use self::{
39    handlers::router,
40    sessions::{Session, Sessions},
41};