Skip to main content

Crate sley_core

Crate sley_core 

Source

Re-exports§

pub use precompose::activate_precompose_unicode;
pub use precompose::has_non_ascii;
pub use precompose::has_non_ascii_bytes;
pub use precompose::precompose_argv_if_needed;
pub use precompose::precompose_bytes_if_needed;
pub use precompose::precompose_os_str_bytes_if_needed;
pub use precompose::precompose_owned_string_if_needed;
pub use precompose::precompose_path_if_needed;
pub use precompose::precompose_string_if_needed;
pub use precompose::precompose_unicode_enabled;
pub use precompose::set_precompose_unicode;
pub use namespace::clear_git_namespace_override;
pub use namespace::expand_namespace;
pub use namespace::get_git_namespace;
pub use namespace::namespace_active;
pub use namespace::ref_is_hidden;
pub use namespace::set_git_namespace_override;
pub use namespace::strip_namespace;
pub use namespace::trim_hidden_ref_pattern;

Modules§

namespace
Git ref namespaces (GIT_NAMESPACE / --namespace).
precompose
macOS HFS+/APFS Unicode path precomposition (core.precomposeunicode).
trace2
Minimal trace2 event-target support (GIT_TRACE2_EVENT).

Structs§

AtomicCancel
Shared atomic cancellation flag.
BString
A byte string for git paths and similar on-disk identifiers.
ByteString
CancelFlag
Cheap cooperative cancel handle for long-running I/O.
CancellableRead
Read adapter that polls a CancelFlag before each underlying read.
Capability
FullName
A validated git ref name (e.g. refs/heads/main, HEAD).
GitTime
A git timestamp: a Unix time plus the committer’s timezone offset.
IdentFields
A tolerant parse-view of a git identity line split git’s way (ident.c’s split_ident_line). Unlike Signature::from_ident_line — which is a strict, byte-exact round-trip parser — this mirrors how git’s pretty-printer recovers fields from broken idents: the email is the run between the first < and the first following >, while the timestamp is located by scanning backwards from the end of the line for the last >. That split lets a corrupt ident like Name <a@b>-<> 123 +0000 still surrender the correct name (Name), email (a@b), and date (123 +0000).
ObjectId
OperationCancelled
Marker error stored inside io::Error when a cooperative cancel fires.
RepoPath
Signature
A typed parse-view of a git identity line (Name <email> <secs> <tz>) as found on a commit’s author/committer or a tag’s tagger header.
StreamingDigest

Enums§

CliExit
Git-compatible CLI exit status. See git help exit-code for the upstream taxonomy.
DateMode
GitError
MissingObjectContext
MissingObjectKind
NotFoundKind
ObjectFormat
StreamControl
Cooperative continue/stop control for callback-style event streams (status rows, revwalk commits, untracked paths, …).

Constants§

UPSTREAM_GIT_COMPAT_VERSION

Functions§

cancel_flag_from_arc
Compatibility: treat a bare atomic reference as a cancel poll source.
cancelled_io_error
Build the I/O error used by CancellableRead on cancel.
cli_exit_code
Map a GitError to the process exit code the CLI should use.
digest_bytes
ident_render_date
Render an ident’s date the way pretty.c’s show_ident_date does: parse the timestamp (git’s parse_timestamp is unsigned/base-10 and clamps on overflow), substitute the epoch sentinel (time = 0, timezone +0000) when the value overflows what a time_t can hold, then format per mode. date is the timestamp digit-run and tz its timezone token (as returned by split_ident_line).
is_cancelled_error
True when err is a cooperative cancellation.
is_cancelled_io
true when err is a cooperative cancel from CancellableRead.
kill_child_if_cancelled
Kill an OS child if cancel was requested (best-effort preemptive wake).
map_cancel_io
Map a cancel-flavored I/O error to GitError::Cancelled; pass other errors through GitError::from.
object_id_for_bytes
original_cwd
redact_url_for_display
Strip embedded credentials from url before showing it in user-facing output.
set_original_cwd
split_ident_line
Split a git identity line the way ident.c’s split_ident_line does, returning None only when the line has no < or no following > (git’s status < 0). The date/timezone fields are None for the “person only” case where no valid timestamp follows the final >.
to_hex

Type Aliases§

DynCancelFlag
Historical name for the type-erased cancel handle; now identical to CancelFlag.
Result