Crate identity_common
source ·Expand description
Types that are shared across more than one crate in the Fuchsia identity stack.
Structs
Data associated with authentication enrollment.
Data associated with an enrollment of an authentication mechanism
capable of storage unlock.
StagedFile is a wrapper around a |&DirectoryProxy| and a |FileProxy|
for a staged file within that directory.
The primary purpose of StagedFile is to implement the atomic write workflow
summarized as open -> write -> sync -> close -> rename. This workflow is
simplified to simply write -> commit.
One caveat to the use of StagedFile is that in the event of power loss or
a crash, there may be orphaned temporary files in the directory.
This means that clients should clean up their directories of temporary
files prior to operating in that directory. As such, it is important to
choose a |filename_prefix| that is guaranteed not to collide with
|target_filename|s given when calling StagedFile::commit.
It would have been preferable to use the tempfile crate here, but it lacks
the ability to open things without making use of paths and namespaces, and
as such, StagedFile should only be used in cases where we must supply our
own |DirectoryProxy|.
TaskGroup manages spawning and gracefully terminating asynchronous tasks on a multi-threaded
Fuchsia executor, where individual tasks receive cancellation signals and are in control of
terminating themselves. This allows the TaskGroup owner to await for completion of the tasks.
TaskGroups can also be nested, allowing for independent cancellation of a child TaskGroup, or
cancelling parent and child TaskGroups together (through cancelling the parent).
Note that a dropped TaskGroup will cancel its own tasks, but not its childrens’ tasks. Hence,
it is not recommended to rely on std::ops::drop, but rather to always use cancel() prior to
destruction. (This might be changed in the future).
Enums
Describes an error with StagedFile usage.
TaskGroupError is the failure type for this module.
Functions
Returns a future which resolves either when cancel or fut is ready. If both are ready, cancel
takes precedence. If the provided future wins, its output is returned. If cancel wins, None
is returned.
Type Definitions
TaskGroupCancel is a future which each task is able to poll for cancellation intent.