pub struct GlobalEnv {Show 20 fields
pub namespaces: RwLock<HashMap<Arc<str>, GcPtr<Namespace>>>,
pub source_paths: RwLock<Vec<PathBuf>>,
pub loaded: Mutex<HashSet<Arc<str>>>,
pub loading: Mutex<HashMap<Arc<str>, ThreadId>>,
pub loading_done: Condvar,
pub builtin_sources: RwLock<HashMap<Arc<str>, &'static str>>,
pub gc_config: RwLock<Option<Arc<GcConfig>>>,
pub async_rt: RwLock<Option<Arc<dyn AsyncRuntime>>>,
pub version_cache: Mutex<HashMap<Arc<str>, Value>>,
pub deps_config: RwLock<Option<Arc<DepsConfig>>>,
pub verify_commit_signatures: AtomicBool,
pub sig_verify_cache: Mutex<HashSet<(Arc<str>, Arc<str>)>>,
pub versioned_sources: RwLock<HashMap<Arc<str>, Arc<str>>>,
pub versioned_offline: AtomicBool,
pub native_provenance: RwLock<HashMap<Arc<str>, Arc<str>>>,
pub enforce_native_versions: AtomicBool,
pub provenance_warned: Mutex<HashSet<Arc<str>>>,
pub pinned_native_loader: RwLock<Option<PinnedNativeLoader>>,
pub native_require_loader: RwLock<Option<NativeRequireLoader>>,
pub compiled_ns_loaders: RwLock<HashMap<Arc<str>, CompiledNsLoader>>,
/* private fields */
}Expand description
The global mutable store of all namespaces.
Fields§
§namespaces: RwLock<HashMap<Arc<str>, GcPtr<Namespace>>>§source_paths: RwLock<Vec<PathBuf>>Directories to search when resolving namespace names to files.
loaded: Mutex<HashSet<Arc<str>>>Namespaces that have been fully loaded from a file (idempotent guard).
loading: Mutex<HashMap<Arc<str>, ThreadId>>Namespaces currently being loaded, mapped to the thread loading them.
Used to detect true circular requires (same thread) vs concurrent loads
(different thread — those wait on loading_done instead of erroring).
loading_done: CondvarSignalled whenever a namespace finishes loading (or fails).
builtin_sources: RwLock<HashMap<Arc<str>, &'static str>>Built-in namespace sources embedded in the binary.
Checked by load_ns before falling back to source-path search.
gc_config: RwLock<Option<Arc<GcConfig>>>GC configuration for automatic collection based on memory pressure.
async_rt: RwLock<Option<Arc<dyn AsyncRuntime>>>Optional async runtime registered by cljrs-async.
None when the library is not linked; Some after cljrs_async::init.
version_cache: Mutex<HashMap<Arc<str>, Value>>Cache of values resolved at a specific commit.
Key format: "<ns>/<name>@<commit>" for individual vars,
or "<ns>@<commit>" for whole versioned namespaces.
deps_config: RwLock<Option<Arc<DepsConfig>>>Parsed cljrs.edn config, loaded once at startup.
verify_commit_signatures: AtomicBoolWhen true, every versioned-symbol or versioned-namespace resolution must
carry a valid commit signature (verified natively against trusted_keys)
before the historical code is executed. Off by default; enabled via
--verify-commit-signatures CLI flag or :verify-commit-signatures true
in cljrs.edn.
sig_verify_cache: Mutex<HashSet<(Arc<str>, Arc<str>)>>Session-scoped cache of commits that have already passed signature
verification this run, keyed by (repo_root, commit_hash).
versioned_sources: RwLock<HashMap<Arc<str>, Arc<str>>>Pinned source texts fetched from git this session, keyed by
"<ns>@<commit>". The AOT compiler embeds these in the produced
binary so versioned namespaces resolve without git at runtime.
versioned_offline: AtomicBoolWhen true (set by AOT harness main), versioned namespaces resolve only from embedded builtin sources — never from git. A versioned namespace that was not embedded at compile time fails with a clear error instead of attempting a fetch.
native_provenance: RwLock<HashMap<Arc<str>, Arc<str>>>Provenance of native (Rust-backed) packages recorded at registration: namespace → the git commit the package was built from. Consulted by the versioned resolver’s native HEAD fallback to detect pinned-commit mismatches.
enforce_native_versions: AtomicBoolWhen true, a pinned lookup of a native function whose recorded
provenance does not match the requested commit is an error instead of
a once-per-pin warning. CLI: --enforce-native-versions; cljrs.edn:
:enforce-native-versions true.
provenance_warned: Mutex<HashSet<Arc<str>>>Pinned-native mismatches already warned about this session
(key: "<ns>@<commit>"), so each pin warns at most once.
pinned_native_loader: RwLock<Option<PinnedNativeLoader>>Optional loader for pinned native packages (:rust/load :dylib),
installed by the CLI. Called by the versioned resolver with
(globals, base_ns, commit) before falling back to the HEAD native
binding; returns Ok(true) when it registered the package’s pinned
implementations into the "<base_ns>@<commit>" namespace.
native_require_loader: RwLock<Option<NativeRequireLoader>>Optional loader for native dependencies on the plain require path
(:rust/load :dylib), installed by the CLI. Called by the
unversioned namespace loader with (globals, ns) when a required
namespace has no Clojure source on the source path; returns Ok(true)
when it built the dep’s crate at the pinned :git/sha and registered
the package’s exports into the unversioned namespace, so a plain
(require '[my.native.lib :as lib]) brings the native code in.
compiled_ns_loaders: RwLock<HashMap<Arc<str>, CompiledNsLoader>>Loaders for AOT-compiled namespaces, installed by the binary
produced by cljrs compile. Keyed by namespace name. When a plain
require resolves a namespace that has a registered loader, load_ns
invokes the loader instead of interpreting Clojure source: the loader
evaluates the namespace’s small interpreted preamble (its ns/require
and macro definitions) and then calls the namespace’s natively compiled
initializer, so the bulk of the namespace runs as machine code rather
than being tree-walked at startup.
Implementations§
Source§impl GlobalEnv
impl GlobalEnv
Sourcepub fn new(execution_mode: ExecutionMode) -> Arc<Self> ⓘ
pub fn new(execution_mode: ExecutionMode) -> Arc<Self> ⓘ
Create an empty global environment for the given execution mode.
This is the raw constructor: no builtins, no bootstrap, no source
paths. Use crate::Runtime::builder unless you are the builder.
Sourcepub fn set_source_paths(&self, paths: Vec<PathBuf>)
pub fn set_source_paths(&self, paths: Vec<PathBuf>)
Replace the source path list.
Sourcepub fn register_builtin_source(&self, ns: &str, src: &'static str)
pub fn register_builtin_source(&self, ns: &str, src: &'static str)
Register an embedded namespace source (called by cljrs-stdlib at startup).
Sourcepub fn builtin_source(&self, ns: &str) -> Option<&'static str>
pub fn builtin_source(&self, ns: &str) -> Option<&'static str>
Look up an embedded source for a namespace, if one has been registered.
Sourcepub fn register_compiled_ns_loader(&self, ns: &str, loader: CompiledNsLoader)
pub fn register_compiled_ns_loader(&self, ns: &str, loader: CompiledNsLoader)
Register a loader for an AOT-compiled namespace (called by the harness
main of a binary produced by cljrs compile).
Sourcepub fn compiled_ns_loader(&self, ns: &str) -> Option<CompiledNsLoader>
pub fn compiled_ns_loader(&self, ns: &str) -> Option<CompiledNsLoader>
Look up the loader for an AOT-compiled namespace, if one is registered.
Sourcepub fn mark_loaded(&self, ns: &str)
pub fn mark_loaded(&self, ns: &str)
Mark a namespace as fully loaded from a file.
Sourcepub fn is_loaded(&self, ns: &str) -> bool
pub fn is_loaded(&self, ns: &str) -> bool
True if the namespace has already been loaded from a file.
Sourcepub fn set_gc_config(&self, config: Arc<GcConfig>)
pub fn set_gc_config(&self, config: Arc<GcConfig>)
Set the GC configuration for automatic memory pressure management.
Sourcepub fn gc_config(&self) -> Option<Arc<GcConfig>>
pub fn gc_config(&self) -> Option<Arc<GcConfig>>
Get the GC configuration, if one has been set.
Sourcepub fn resolve_alias(&self, current_ns: &str, alias: &str) -> Option<Arc<str>>
pub fn resolve_alias(&self, current_ns: &str, alias: &str) -> Option<Arc<str>>
Resolve a short alias to a full namespace name in current_ns.
Sourcepub fn resolve_auto_keyword(
&self,
current_ns: &str,
name: &str,
) -> Result<String, String>
pub fn resolve_auto_keyword( &self, current_ns: &str, name: &str, ) -> Result<String, String>
Resolve an auto-resolved keyword name (the text after ::) to its
fully-qualified ns/name form.
::kw qualifies with current_ns directly; ::alias/kw looks
alias up in current_ns’s alias table (populated by (require '[... :as alias])) and qualifies with the resolved namespace.
Sourcepub fn get_or_create_ns(&self, name: &str) -> GcPtr<Namespace>
pub fn get_or_create_ns(&self, name: &str) -> GcPtr<Namespace>
Return the namespace with this name, creating it if it doesn’t exist.
Sourcepub fn intern(&self, ns_name: &str, name: Arc<str>, val: Value) -> GcPtr<Var>
pub fn intern(&self, ns_name: &str, name: Arc<str>, val: Value) -> GcPtr<Var>
Intern name with val in the given namespace, returning the Var.
Sourcepub fn lookup_var(&self, ns_name: &str, sym_name: &str) -> Option<GcPtr<Var>>
pub fn lookup_var(&self, ns_name: &str, sym_name: &str) -> Option<GcPtr<Var>>
Look up a Var in the named namespace (interns only).
Sourcepub fn lookup_in_ns(&self, ns_name: &str, sym_name: &str) -> Option<Value>
pub fn lookup_in_ns(&self, ns_name: &str, sym_name: &str) -> Option<Value>
Look up a value in ns_name: checks interns then refers.
Routes through the dynamic binding stack so binding overrides work.
Sourcepub fn lookup_var_in_ns(
&self,
ns_name: &str,
sym_name: &str,
) -> Option<GcPtr<Var>>
pub fn lookup_var_in_ns( &self, ns_name: &str, sym_name: &str, ) -> Option<GcPtr<Var>>
Look up the raw Var (not its value) in ns_name: interns then refers.
Sourcepub fn refer_all(&self, dst_ns: &str, src_ns: &str)
pub fn refer_all(&self, dst_ns: &str, src_ns: &str)
Copy all interns from src_ns into dst_ns as refers.
Sourcepub fn refer_named(&self, dst_ns: &str, src_ns: &str, names: &[Arc<str>])
pub fn refer_named(&self, dst_ns: &str, src_ns: &str, names: &[Arc<str>])
Copy selected interns from src_ns into dst_ns as refers.
Sourcepub fn add_alias(&self, current_ns: &str, alias: &str, full_ns: &str)
pub fn add_alias(&self, current_ns: &str, alias: &str, full_ns: &str)
Register alias → full_ns in current_ns’s alias table.
Sourcepub fn jit_backend(&self) -> Option<Arc<dyn JitBackend>>
pub fn jit_backend(&self) -> Option<Arc<dyn JitBackend>>
The JIT compiler attached to this runtime, if any.
None when no JIT is linked or installed; callers then keep to the
interpreter tiers. Installed by cljrs_compiler::jit::install.
Sourcepub fn execution_mode(&self) -> ExecutionMode
pub fn execution_mode(&self) -> ExecutionMode
How this runtime executes function calls.
Sourcepub fn tier_state(&self) -> TierState
pub fn tier_state(&self) -> TierState
Which tiers are live right now.
Sourcepub fn set_tier_state(&self, tier: TierState)
pub fn set_tier_state(&self, tier: TierState)
Raise the live tier state. Called once by the runtime builder after the bootstrap completes; lowering the tier is not supported, so a request below the current state is ignored.
Sourcepub fn ir_enabled(&self) -> bool
pub fn ir_enabled(&self) -> bool
True when IR may be lowered, cached, and interpreted. This is the
gate the old compiler_ready flag served.
Sourcepub fn eval(&self, form: &Form, env: &mut Env) -> EvalResult
pub fn eval(&self, form: &Form, env: &mut Env) -> EvalResult
Evaluate form in env.
Sourcepub fn call_cljrs_fn(
&self,
func: &CljxFn,
args: &[Value],
env: &mut Env,
) -> EvalResult
pub fn call_cljrs_fn( &self, func: &CljxFn, args: &[Value], env: &mut Env, ) -> EvalResult
Call a Clojure function, taking the path this runtime’s
ExecutionMode selects.
This is the single function-call dispatch point: tree walk, tier-1 IR, and JIT-native execution are all reached from here.
Sourcepub fn on_fn_defined(&self, f: &CljxFn, env: &mut Env)
pub fn on_fn_defined(&self, f: &CljxFn, env: &mut Env)
Notify the active tier that a new fn* was defined.
In a tiered runtime with IR enabled this eagerly lowers the function (when eager lowering is on); in every other mode it does nothing.
Sourcepub fn set_async_runtime(&self, rt: Arc<dyn AsyncRuntime>)
pub fn set_async_runtime(&self, rt: Arc<dyn AsyncRuntime>)
Install an async runtime. Called once by cljrs_async::init.
Subsequent calls are silently ignored (first writer wins).
Sourcepub fn async_runtime(&self) -> Option<Arc<dyn AsyncRuntime>>
pub fn async_runtime(&self) -> Option<Arc<dyn AsyncRuntime>>
Return the async runtime, if one has been registered.
Sourcepub fn get_ns_git_context(&self, ns_name: &str) -> Option<(Arc<str>, Arc<str>)>
pub fn get_ns_git_context(&self, ns_name: &str) -> Option<(Arc<str>, Arc<str>)>
Return (source_file, git_repo_root) for the named namespace, if
both have been populated by the loader.
Sourcepub fn cache_versioned(&self, ns: &str, name: &str, commit: &str, val: Value)
pub fn cache_versioned(&self, ns: &str, name: &str, commit: &str, val: Value)
Store a resolved versioned value in the cache.
Key: "<ns>/<name>@<commit>".
Sourcepub fn get_cached_versioned(
&self,
ns: &str,
name: &str,
commit: &str,
) -> Option<Value>
pub fn get_cached_versioned( &self, ns: &str, name: &str, commit: &str, ) -> Option<Value>
Retrieve a previously resolved versioned value, if cached.
Sourcepub fn cache_versioned_ns(&self, ns: &str, commit: &str)
pub fn cache_versioned_ns(&self, ns: &str, commit: &str)
Mark namespace name@commit as loaded in the standard loaded set.
Sourcepub fn record_versioned_source(&self, versioned_ns: &str, src: &str)
pub fn record_versioned_source(&self, versioned_ns: &str, src: &str)
Record the source text of a versioned namespace fetched from git.
Key: "<ns>@<commit>". Consumed by the AOT compiler for embedding.
Sourcepub fn versioned_sources_snapshot(&self) -> Vec<(Arc<str>, Arc<str>)>
pub fn versioned_sources_snapshot(&self) -> Vec<(Arc<str>, Arc<str>)>
Snapshot of all versioned sources fetched this session, sorted by key.
Sourcepub fn set_versioned_offline(&self, offline: bool)
pub fn set_versioned_offline(&self, offline: bool)
Restrict versioned-namespace resolution to embedded builtin sources (no git). Called by AOT harness binaries, which embed every pinned source discovered at compile time.
Sourcepub fn versioned_offline(&self) -> bool
pub fn versioned_offline(&self) -> bool
True when versioned namespaces may only come from embedded sources.
Sourcepub fn set_native_provenance(&self, ns: &str, commit: &str)
pub fn set_native_provenance(&self, ns: &str, commit: &str)
Record the git commit a native (Rust-backed) package was built from.
Called at registration time (Registry::set_provenance or the
register_provenance! inventory entry in cljrs-interop).
Sourcepub fn native_provenance_for(&self, ns: &str) -> Option<Arc<str>>
pub fn native_provenance_for(&self, ns: &str) -> Option<Arc<str>>
The recorded provenance commit for a native package’s namespace.
Sourcepub fn set_enforce_native_versions(&self, enforce: bool)
pub fn set_enforce_native_versions(&self, enforce: bool)
Make pinned-native provenance mismatches hard errors.
Sourcepub fn enforce_native_versions(&self) -> bool
pub fn enforce_native_versions(&self) -> bool
True when pinned-native provenance mismatches are errors.
Sourcepub fn set_pinned_native_loader(&self, loader: PinnedNativeLoader)
pub fn set_pinned_native_loader(&self, loader: PinnedNativeLoader)
Install the pinned-native package loader (called once by
cljrs::native::pinned::install; first writer wins).
Sourcepub fn set_native_require_loader(&self, loader: NativeRequireLoader)
pub fn set_native_require_loader(&self, loader: NativeRequireLoader)
Install the native-dependency require loader (called once by
cljrs::native::pinned::install; first writer wins).
Sourcepub fn vcs(&self) -> Option<Arc<dyn VcsProvider>>
pub fn vcs(&self) -> Option<Arc<dyn VcsProvider>>
The installed VCS backend, or None when this build has none (see
crate::env::vcs). Callers must degrade gracefully: “no provider”
means “this source file is not in a git repository”.
Sourcepub fn set_vcs_provider(&self, provider: Option<Arc<dyn VcsProvider>>)
pub fn set_vcs_provider(&self, provider: Option<Arc<dyn VcsProvider>>)
Replace the VCS backend. Lets an embedder that built without the
deps feature supply its own git implementation, or a sandboxed host
remove the default one (None) so no versioned resolution can reach
the filesystem’s git history.
Drops every cached signature verdict: those were reached by the
outgoing provider, against its trust set and its view of the
repository, and say nothing about what the incoming one would decide
for the same (repo, commit). Keeping them would let a permissive
provider launder an approval for source a later provider serves.
Sourcepub fn invalidate_signature_cache(&self)
pub fn invalidate_signature_cache(&self)
Forget every cached signature verdict, so the next
check_commit_signature re-asks the
current provider. Called whenever the thing that produced those
verdicts changes: the provider itself, or its trusted-key set.
Sourcepub fn check_commit_signature(
&self,
repo_root: &str,
commit: &str,
) -> EvalResult<()>
pub fn check_commit_signature( &self, repo_root: &str, commit: &str, ) -> EvalResult<()>
If :verify-commit-signatures is enabled, verify that commit inside
repo_root carries a valid GPG or SSH signature.
Returns Ok(()) immediately when the feature is off. On the happy
path the result is cached per (repo_root, commit) so each commit is
only verified once per session. On failure returns
EvalError::CommitSignatureVerificationFailed.
If verification is demanded but this build has no VCS provider, the check fails: silently accepting an unverifiable commit would defeat the flag the user explicitly turned on.
Sourcepub fn load_trusted_signers(&self, config: &DepsConfig) -> usize
pub fn load_trusted_signers(&self, config: &DepsConfig) -> usize
Build the trusted-signer key set from a parsed cljrs.edn config and
install it, so subsequent check_commit_signature calls verify against
it. Inline keys are parsed directly; File entries are read from disk.
Returns the number of keys loaded; warns (to stderr) on any key that
fails to load rather than aborting. Returns 0 when this build has no
VCS provider, since there is nothing that could consume the keys.
Replacing the trust set invalidates the signature cache for the same reason replacing the provider does: a verdict reached under the old keys is not a verdict under the new ones. (In the normal flow this runs at session start, before anything has been verified.)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GlobalEnv
impl !RefUnwindSafe for GlobalEnv
impl !Send for GlobalEnv
impl !Sync for GlobalEnv
impl !UnwindSafe for GlobalEnv
impl Unpin for GlobalEnv
impl UnsafeUnpin for GlobalEnv
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.