Cargo Features

casbin = { version = "2.1.0", default-features = false, features = ["amortized", "cached", "explain", "glob", "incremental", "ip", "logging", "runtime-async-std", "runtime-tokio", "watcher", "tokio", "tokio-stream"] }
default = incremental, runtime-tokio

These default features are set whenever casbin is added without default-features = false somewhere in the dependency tree.


Enables ahash-amortized and inline-more-amortized of ritelinked

cached = mini-moka

Affects effector::EffectorStream.explain, logger::Logger.print_explain_log

glob = globset

Affects function_map::glob_match

incremental default

Affects core_api::CoreApi.build_incremental_role_links, model::Model.build_incremental_role_links

ip = ip_network

Affects function_map::ip_match

logging = slog, slog-async, slog-term

Affects core_api::CoreApi.get_logger, core_api::CoreApi.set_logger, core_api::CoreApi.enable_log

runtime-async-std = async-std
runtime-tokio default

Enables fs and io-util of tokio


Affects core_api::CoreApi.set_watcher, core_api::CoreApi.get_watcher, core_api::CoreApi.get_mut_watcher, core_api::CoreApi.enable_auto_notify_watcher, core_api::CoreApi.has_auto_notify_watcher_enabled

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

async-std runtime-async-std?

With default features

globset glob?

With default (log)

ip_network ip?
mini-moka cached?

With default (sync)

slog logging?

With default (std)

slog-async logging?
slog-term logging?
tokio implicit feature
tokio-stream implicit feature