Crate mm0_util[−][src]
Expand description
Utilities, mainly path manipulation with some newtype definitions.
The types Position
and Range
will be different depending on whether
the server
feature is enabled.
Macros
Does the same as panic!
but works in a const fn
.
let_unchecked!(x as p = e)
is the same asLike unwrap
, but invokes undefined behavior instead of panicking.
Structs
A linked list data structure based on Arc
.
An iterator over an ArcList
.
Newtype for an Arc<String>
, so that we can implement From<&str>
.
An index into a AtomVec
A vector wrapper with a strongly typed index interface.
A PathBuf
created by lazy_static!
pointing to a canonicalized “.”
A reference to a file. It wraps an Arc
so it can be cloned thread-safely.
A FileRef
can be constructed either from a PathBuf
or a
(file://
) Url
,
and provides (precomputed) access to these views using
path()
and url()
, as well as
rel()
to get the relative path from CURRENT_DIR
.
A span paired with a FileRef
.
Wrapper around std’s String which stores data about the positions of any newline characters.
Visibility and sort modifiers for Sort statements and Declarations.
Position in a text document expressed as zero-based line and character offset. A position is between two characters like an ‘insert’ cursor in a editor.
A range in a text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor. Therefore the end position is exclusive.
A way to initialize a Box<[T]>
by first constructing the array (giving the length),
initializing the elements in some order, and then using the unsafe function
assume_init
to assert that every element of the array has been initialized and
transmute the SliceUninit<T>
into a Box<[T]>
.
An index into a SortVec
A vector wrapper with a strongly typed index interface.
Points to a specific region of a source file by identifying the region’s start and end points.
A structure that allows constructing linked lists on the call stack.
An index into a TermVec
A vector wrapper with a strongly typed index interface.
An index into a ThmVec
A vector wrapper with a strongly typed index interface.
Enums
A precedence literal, such as 123
or max
. These are used in notations like
notation add = ($+$:23)
or infix add: $+$ prec 23;
.
Constants
The precedence of application, 1024
. This determines whether
f x + y
is interpreted as f (x + y)
or (f x) + y
,
by comparing the precedence of +
to APP_PREC
.
Traits
Extension trait for Condvar
.
Extension trait for HashMap
<K, V>
.
Extension trait for Mutex
<T>
.
Extension trait for HashMap
<K, V>
.
Extension trait for cloned_box
.
Functions
Translate a number into an alphabetic numbering system, indexing into the following infinite sequence:
Try to get total memory usage (stack + data) in bytes using the /proc
filesystem.
Falls back on getrusage()
if procfs doesn’t exist.
Converts n
from u32
to usize
or panics (which should not happen since we don’t support
16 bit systems).
Type Definitions
Newtype for Box<dyn Error + Send + Sync>