#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![allow(rustdoc::all)]
#![allow(unknown_lints)]
#![allow(
effect_success_should_be_fn_type_param,
effect_no_effect_suffix_on_graph_builder,
effect_run_blocking_outside_boundary,
effect_run_async_outside_boundary,
effect_prefer_from_async_over_new_async,
effect_from_async_single_await,
effect_effect_generics_need_bounds,
effect_multiple_top_level_effect_macros,
effect_returning_effect_should_use_effect_macro,
effect_no_async_fn_application,
clippy::doc_overindented_list_items,
clippy::should_implement_trait,
clippy::type_complexity,
clippy::unnecessary_lazy_evaluations
)]
#![cfg_attr(
test,
allow(
clippy::bool_assert_comparison,
clippy::clone_on_copy,
clippy::empty_line_after_doc_comments,
clippy::let_unit_value,
clippy::map_identity,
clippy::redundant_closure,
clippy::unit_arg,
clippy::unit_cmp,
)
)]
extern crate self as effectful;
#[allow(deprecated)]
pub use effectful_macro::{ctx, err, layer_graph, layer_node, pipe, req, service_def, service_key};
pub use effectful_proc_macro::{
EffectData, Service, TaggedError, effect, effect_tagged, effect_test, span,
};
pub mod algebra;
pub mod collections;
pub mod concurrency;
pub mod context;
pub mod coordination;
pub mod failure;
pub mod foundation;
pub mod kernel;
pub mod layer;
pub mod macros;
pub mod observability;
pub mod resource;
pub mod runtime;
pub mod scheduling;
pub mod schema;
pub mod stm;
pub mod streaming;
pub mod testing;
pub use crate::kernel::{
BoxFuture, Effect, IntoBind, IntoBindFastExt, acquire_release, box_future, fail, from_async,
into_bind, into_bind_fast, pure, scope_with, scoped, succeed,
};
pub use collections::{
ChunkBuilder, EffectHashMap, EffectHashSet, EffectSortedMap, EffectSortedSet, EffectVector,
MutableHashMap, MutableHashSet, MutableList, MutableQueue, RedBlackTree, Trie,
};
pub use concurrency::{
CancellationToken, FiberHandle, FiberId, FiberRef, FiberStatus, check_interrupt, fiber_all,
fiber_never, fiber_succeed, interrupt_all, with_fiber_id,
};
pub use context::Service as ContextService;
pub use context::{
Cons, Context, Get, GetMut, HasTag, Here, IntoServiceContext, Matcher, MissingService, Nil,
ServiceContext, ServiceLookup, Skip0, Skip1, Skip2, Skip3, Skip4, Tag, Tagged, There, ThereHere,
prepend_cell, tagged,
};
pub use coordination::semaphore::Permit;
pub use coordination::{
Channel, ChannelReadError, Deferred, Latch, PubSub, Queue, QueueChannel, QueueError, Ref,
Semaphore, SynchronizedRef,
};
pub use failure::{Cause, Exit, Or};
pub use foundation::either::Either;
pub use foundation::func::{
always, compose, const_, flip, identity, memoize, pipe1, pipe2, pipe3, tupled, untupled,
};
pub use foundation::mutable_ref::MutableRef;
pub use foundation::piping::Pipe;
pub use foundation::predicate::Predicate;
pub use layer::service::{
Service, ServiceEnv, layer_service, layer_service_env, provide_service, service, service_env,
};
pub use layer::{
Layer, LayerBuild, LayerDiagnostic, LayerEffect, LayerError, LayerExt, LayerFn, LayerFnFrom,
LayerFrom, LayerGraph, LayerMissingProvider, LayerNode, LayerPlan, LayerPlannerError,
LayerRequirements, MemoizedLayer, MergedLayer, Stack, StackThen, TypedLayer, TypedLayerExt,
merge_all,
};
pub use observability::{
__effectful_span_lazy, __effectful_span_lazy_scoped, AnnotateCurrentSpanErr,
AnnotateCurrentSpanSuccess, EffectEvent, FiberEvent, GlobalTraceCollector, LogSpan, Metric,
SequentialTraceContextProvider, SpanAttributeValue, SpanContext, SpanEvent, SpanId, SpanLevel,
SpanOptions, SpanRecord, SpanStatus, TraceCollector, TraceContextProvider, TraceFlags, TraceId,
TraceParentParseError, TracingConfig, TracingFiberRefs, TracingSnapshot, annotate_current_span,
annotate_current_span_attribute, emit_current_span_event,
emit_current_span_event_with_attributes, emit_effect_event, emit_fiber_event,
install_tracing_layer, install_tracing_layer_with_clock,
install_tracing_layer_with_context_provider,
install_tracing_layer_with_context_provider_and_clock, metric_make, snapshot_tracing,
tracing_enabled, with_span, with_span_options, with_span_options_collected,
with_span_options_collected_with_parent,
};
pub use resource::{Cache, CacheStats, Finalizer, KeyedPool, Pool, Scope};
pub use runtime::{
Never, Runtime, ThreadSleepRuntime, run_async, run_blocking, run_fork, yield_now,
};
pub use scheduling::{
AnyDateTime, Clock, Duration, DurationParseError, LiveClock, Schedule, ScheduleDecision,
ScheduleInput, TestClock, TimeUnit, UtcDateTime, ZonedDateTime, forever, repeat, repeat_n,
repeat_with_clock, repeat_with_clock_and_interrupt, retry, retry_with_clock,
retry_with_clock_and_interrupt, timezone,
};
pub use schema::brand::Brand;
pub use schema::data::{DataError, DataStruct, DataTuple, EffectData as EffectDataTrait};
pub use schema::equal::{EffectHash, Equal};
pub use schema::order::{DynOrder, Ordering, ordering};
pub use schema::{HasSchema, ParseError, ParseErrors, Schema, Unknown};
pub use stm::{Outcome, Stm, TMap, TQueue, TRef, TSemaphore, Txn, atomically, commit};
pub use streaming::stream::{StreamBroadcastFanout, StreamChannelFull, StreamSender, StreamV1};
pub use streaming::{
BackpressureDecision, BackpressurePolicy, Chunk, Sink, Stream, backpressure_decision, end_stream,
send_chunk, stream_from_channel, stream_from_channel_with_policy,
};
pub use testing::{
TestRuntime, assert_no_leaked_fibers, assert_no_unclosed_scopes, record_leaked_fiber,
record_unclosed_scope, run_effect_test, run_effect_test_with_env, run_test, run_test_with_clock,
};
pub use context::match_;
pub use coordination::channel;
pub use coordination::ref_;
pub use foundation::either;
pub use foundation::func;
pub use scheduling::clock;
pub use scheduling::duration;
pub use scheduling::schedule;
pub use schema::data;
pub use streaming::stream;
pub use testing::snapshot;
pub use im;