engula_journal/
lib.rs

1// Copyright 2021 The Engula Authors.
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//! An Engula module that provides stream storage abstractions and
16//! implementations.
17//!
18//! # Abstraction
19//!
20//! [`Journal`] is an abstraction to store data streams.
21//!
22//! # Implementation
23//!
24//! Some built-in implementations of [`Journal`]:
25//!
26//! - [`mem`](crate::mem)
27//! - [`file`](crate::file)
28//! - [`grpc`](crate::grpc)
29//!
30//! [`Journal`]: crate::Journal
31
32mod error;
33mod journal;
34mod stream;
35
36pub mod file;
37pub mod grpc;
38pub mod mem;
39
40pub use async_trait::async_trait;
41
42pub type ResultStream<T> = futures::stream::BoxStream<'static, Result<T>>;
43
44pub use self::{
45    error::{Error, Result},
46    journal::Journal,
47    stream::{Event, Stream, Timestamp},
48};