Instances of this class represent the length of an interval of time.
Negative durations are allowed, meaning the end is before the start.
Platform-specific implementation details of BaseTimeDuration.
CompactPair is the logical concatenation of an instance of A with an instance
B. Space is conserved when possible. Neither A nor B may be a final class.
This class is designed to cause crashes when various kinds of memory
corruption are observed. For instance, let’s say we have a class C where we
suspect out-of-bounds writes to some members. We can insert a member of type
Poison near the members we suspect are being corrupted by out-of-bounds
writes. Or perhaps we have a class K we suspect is subject to use-after-free
violations, in which case it doesn’t particularly matter where in the class
we add the member of type Poison.
A version of CorruptionCanary that is suitable as a member of objects that
are statically allocated.
DebugOnly contains a value of type T, but only in debug builds. In release
builds, it does not contain a value. This helper is intended to be used with
MOZ_ASSERT()-style macros, allowing one to write:
A default deletion policy using plain old operator delete.
EnumSet<T, U> is a set of values defined by an enumeration. It is implemented
using a bit mask with the size of U for each value. It works both for enum
and enum class types. EnumSet also works with U being a BitSet.
A tag used to differentiate between GenericErrorResult created by the Err
function (completely new error) and GenericErrorResult created by the
Result::propagateErr function (propagated error). This can be used to track
error propagation and eventually produce error stacks for logging/debugging
purposes.
A type that auto-converts to an error Result. This is like a Result without
a success type. It’s the best return type for functions that always return
an error–functions designed to build and populate error objects. It’s also
useful in error-handling macros; see MOZ_TRY for an example.
A pseudorandom function mapping 32-bit integers to 32-bit integers.
Empty struct, indicating success for operations that have no return value.
For example, if you declare another empty struct struct OutOfMemory {};
,
then Result<Ok, OutOfMemory>
represents either success or OOM.
Opaque is a replacement for integral T in cases where only comparisons
must be supported, and it’s desirable to prevent accidental dependency on
exact values.
Result<V, E> represents the outcome of an operation that can either succeed
or fail. It contains either a success value of type V or an error value of
type E.
Perform arithmetic operations on the value of a BaseTimeDuration without
doing strict checks on the range of values.
Instances of this class represent moments in time, or a special
“null” moment. We do not use the non-monotonic system clock or
local time, since they can be reset, causing apparent backward
travel in time, which can confuse algorithms. Instead we measure
elapsed time according to the system. This time can never go
backwards (i.e. it never wraps around, at least not in less than
five million years of system elapsed time). It might not advance
while the system is sleeping. If TimeStamp::SetNow() is not called
at all for hours or days, we might not notice the passage of some
of that time.
UniquePtr is a smart pointer that wholly owns a resource. Ownership may be
transferred out of a UniquePtr through explicit action, but otherwise the
resource is destroyed when the UniquePtr is destroyed.
mozilla::Variant