Skip to main content

lace_rt/
lib.rs

1//! Standalone synchronous Rust runtime for Lace with Mio-driven I/O.
2//!
3//! Each bounded operation owns its reactor. An open interlace retains the
4//! reactor for its lifetime. No Tokio runtime, task, or hidden transport worker
5//! participates.
6
7#[cfg(feature = "compiler")]
8pub use lace_compiler::{
9    CompilationError, CompilationErrorKind, CompilationLimits, compile, compile_with_limits,
10};
11pub use lace_sans_io::core::{ChannelBinding, ErrorCategory, PeerProofAssurance, SessionOperand};
12pub use lace_sans_io::logic::{
13    FieldExclusion, InterlaceModule, PreparationError, prepare_facet_constraints,
14};
15pub use lace_sans_io::runtime_values::{
16    BoundedInterlaceOutcome, ConnectedPeerOptions, Error, GetOutcome, InterlaceEvent,
17    InterlaceOperationOptions, ListOutcome, OpenBoundary, OpenBoundaryOutcome, OpenEvent,
18    ParticipantPosition, StoreOutcome, StoreRecordDisposition, StoreRecordResult, Terminal,
19    TimeoutPhase,
20};
21pub use policy::IntoPolicy;
22
23#[cfg(all(target_pointer_width = "64", any(unix, windows)))]
24mod compaction;
25mod driver;
26mod io;
27mod operations;
28pub mod policy;
29mod record_stream;
30mod runtime;
31mod transport;
32
33#[cfg(feature = "lmdb")]
34pub use compaction::compact_lmdb;
35#[cfg(all(target_pointer_width = "64", any(unix, windows)))]
36pub use compaction::{ArenaRelease, CompactionReport, compact_filesystem};
37pub use io::{IoSettings, configure_io};
38pub use lace_sans_io::core::CarrierRole;
39pub use lace_sans_io::iltp::{PortText, StreamEncoding};
40pub use lace_sans_io::runtime_support::portable_file_store::PortableStoreFormat;
41pub use operations::*;
42pub use record_stream::{RecordStream, read_record_stream};
43pub use runtime::{ConnectedPeer, Lace, LaceHandle, LocalPeer, Participant};
44pub use transport::WriteShutdown;
45
46pub mod records {
47    pub use lace_sans_io::records::{
48        BySecret, ByValue, FieldOccurrence, IntoRecordBatch, Record, RecordCreateError,
49        RecordError, RecordHash, RecordKind, RecordMetadata, RecordReadError, RecordSpec,
50        generate_by_secret, new_record,
51    };
52    pub use lace_sans_io::{record, spec};
53}
54
55pub use lace_sans_io::{record, spec};
56pub use records::{
57    BySecret, ByValue, FieldOccurrence, IntoRecordBatch, Record, RecordCreateError, RecordHash,
58    RecordKind, RecordSpec, generate_by_secret, new_record,
59};
60
61pub mod types {
62    pub use crate::{
63        BoundedInterlaceOutcome, ErrorCategory, GetOutcome, InterlaceEvent,
64        InterlaceOperationOptions, ListOutcome, OpenBoundary, OpenBoundaryOutcome,
65        ParticipantPosition, StoreOutcome, StoreRecordDisposition, StoreRecordResult, Terminal,
66        TimeoutPhase,
67    };
68    pub use crate::{InterlaceModule, IntoPolicy};
69    pub use lace_sans_io::core::{
70        ChannelBinding, CloseReason, InterlaceResourceLimits, PeerProofAssurance, SessionOperand,
71    };
72    pub use lace_sans_io::iltp::PortText;
73}
74
75pub mod prelude {
76    pub use crate::types::{
77        CloseReason, ErrorCategory, InterlaceEvent, InterlaceModule, InterlaceResourceLimits,
78        IntoPolicy, ParticipantPosition, TimeoutPhase,
79    };
80    pub use crate::{
81        BoundedInterlaceOutcome, BySecret, ByValue, CarrierRole, ChannelBinding, ConnectedPeer,
82        ConnectedPeerOptions, Error, FieldOccurrence, ForEachStream, GetOutcome,
83        InterlaceOperationOptions, IntoRecordBatch, Lace, LaceHandle, ListOutcome, LocalPeer,
84        OpenBoundary, OpenBoundaryOutcome, OpenEvent, OpenInterlace, Participant,
85        PeerProofAssurance, PortText, PortableStoreFormat, Record, RecordCreateError, RecordHash,
86        RecordKind, RecordSpec, RecordStream, Result, SessionOperand, StoreOutcome,
87        StoreRecordDisposition, StoreRecordResult, StoreStream, StreamEncoding, Terminal,
88        bounded_interlace, bounded_interlace_with_options, for_each, for_each_with_options,
89        generate_by_secret, get, get_with_options, list, list_with_options, new_record,
90        open_interlace, open_interlace_with_options, open_interlace_with_selector,
91        read_record_stream, record, spec, store, store_stream, store_stream_with_options,
92        store_with_options,
93    };
94}
95
96pub type Result<T> = std::result::Result<T, Error>;
97
98#[cfg(test)]
99mod tests;