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§
- const_
panic - Does the same as
panic!but works in aconst fn. - let_
unchecked let_unchecked!(x as p = e)is the same as- unwrap_
unchecked - Like
unwrap, but invokes undefined behavior instead of panicking.
Structs§
- ArcList
- A linked list data structure based on
Arc. - ArcList
Iter - An iterator over an
ArcList. - ArcString
- Newtype for an
Arc<String>, so that we can implementFrom<&str>. - AtomId
- An index into a
AtomVec - AtomVec
- A vector wrapper with a strongly typed index interface.
- CURRENT_
DIR - A
PathBufcreated bylazy_static!pointing to a canonicalized “.” - FileRef
- A reference to a file. It wraps an
Arcso it can be cloned thread-safely. AFileRefcan be constructed either from aPathBufor a (file://)Url, and provides (precomputed) access to these views usingpath()andurl(), as well asrel()to get the relative path fromCURRENT_DIR. - File
Span - A span paired with a
FileRef. - Lined
String - Wrapper around std’s String which stores data about the positions of any newline characters.
- Modifiers
- Visibility and sort modifiers for Sort statements and Declarations.
- Position
- 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.
- Range
- 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.
- Slice
Uninit - 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 functionassume_initto assert that every element of the array has been initialized and transmute theSliceUninit<T>into aBox<[T]>. - SortId
- An index into a
SortVec - SortVec
- A vector wrapper with a strongly typed index interface.
- Span
- Points to a specific region of a source file by identifying the region’s start and end points.
- Stack
List - A structure that allows constructing linked lists on the call stack.
- TermId
- An index into a
TermVec - TermVec
- A vector wrapper with a strongly typed index interface.
- ThmId
- An index into a
ThmVec - ThmVec
- A vector wrapper with a strongly typed index interface.
Enums§
- Prec
- A precedence literal, such as
123ormax. These are used in notations likenotation add = ($+$:23)orinfix add: $+$ prec 23;.
Constants§
- APP_
PREC - The precedence of application,
1024. This determines whetherf x + yis interpreted asf (x + y)or(f x) + y, by comparing the precedence of+toAPP_PREC.
Traits§
- Condvar
Ext - Extension trait for
Condvar. - Hash
MapExt - Extension trait for
HashMap<K, V>. - Mutex
Ext - Extension trait for
Mutex<T>. - RcExt
- Extension trait for
HashMap<K, V>. - Slice
Ext - Extension trait for
cloned_box.
Functions§
- alphanumber
- Translate a number into an alphabetic numbering system, indexing into the following infinite sequence:
- get_
memory_ usage - Try to get total memory usage (stack + data) in bytes using the
/procfilesystem. Falls back ongetrusage()if procfs doesn’t exist. - u32_
as_ usize - Converts
nfromu32tousizeor panics (which should not happen since we don’t support 16 bit systems).
Type Aliases§
- BoxError
- Newtype for
Box<dyn Error + Send + Sync>