Crate zed_util

Crate zed_util 

Source

Re-exports§

pub use self::shell::get_default_system_shell;
pub use self::shell::get_default_system_shell_preferring_bash;
pub use self::shell::get_system_shell;

Modules§

arc_cow
archive
command
fs
markdown
paths
redact
rel_path
schemars
serde
shell
shell_env
size
time

Macros§

debug_panic
maybe
Expands to an immediately-invoked function expression. Good for using the ? operator in functions which do not return an Option or Result.

Structs§

Deferred
LogErrorFuture
NumericPrefixWithSuffix
A way to sort strings with starting numbers numerically first, falling back to alphanumeric one, case-insensitive.
UnwrapFuture

Enums§

ConnectionResult

Traits§

RangeExt
ResultExt
TakeUntilExt
TakeUntilExt is an extension trait for iterators. It adds the Self::take_until method.
TryFutureExt

Functions§

asset_str
Get an embedded file as a string.
capitalize
Capitalizes the first character of a string.
default
defer
Run the given function when the returned value is dropped (unless it’s cancelled).
expanded_and_wrapped_usize_range
extend_sorted
Extend a sorted vector with a sorted sequence of items, maintaining the vector’s sort order and enforcing a maximum length. This also de-duplicates items. Sort the items according to the given callback. Before calling this, both vec and new_items should already be sorted according to the cmp comparator.
get_shell_safe_zed_path
Returns a shell escaped path for the current zed executable
get_zed_cli_path
Returns a path for the zed cli executable, this function should be called from the zed executable, not zed-cli.
load_login_shell_environment
log_err
measure
merge_json_lenient_value_into
merge_json_value_into
merge_non_null_json_value_into
post_inc
prevent_root_execution
Prevents execution of the application with root privileges on Unix systems.
set_pre_exec_to_start_new_session
Configures the process to start a new session, to prevent interactive shells from taking control of the terminal.
some_or_debug_panic
split_str_with_ranges
Similar to str::split, but also provides byte-offset ranges of the results. Unlike str::split, this is not generic on pattern types and does not return an Iterator.
truncate
truncate_and_remove_front
Removes characters from the front of the string if its length is greater than max_chars and prepends the string with “…”. Returns string unchanged if its length is smaller than max_chars.
truncate_and_trailoff
Removes characters from the end of the string if its length is greater than max_chars and appends “…” to the string. Returns string unchanged if its length is smaller than max_chars.
truncate_lines_and_trailoff
Takes only max_lines from the string and, if there were more than max_lines-1, appends a a newline and “…” to the string, so that max_lines are returned. Returns string unchanged if its length is smaller than max_lines.
truncate_lines_to_byte_limit
Takes a prefix of complete lines which fit within the byte limit. If the first line is longer than the limit, truncates at a character boundary.
truncate_to_bottom_n_sorted_by
truncate_to_byte_limit
Truncates the string at a character boundary, such that the result is less than max_bytes in length.
word_consists_of_emojis
Returns true if the given string consists of emojis only. E.g. “👨‍👩‍👧‍👧👋” will return true, but “👋!” will return false.
wrapped_usize_outward_from
Yields [i, i + 1, i - 1, i + 2, ..], each modulo wrap_length and bounded by additional_before and additional_after. If the wrapping causes overlap, duplicates are not emitted. If wrap_length is 0, nothing is yielded.