Struct tree_magic::TypeStruct

source ·
pub struct TypeStruct {
    pub graph: DiGraph<String, u32>,
    pub hash: FnvHashMap<String, NodeIndex>,
}
Expand description

Information about currently loaded MIME types

The graph contains subclass relations between all given mimes. (EX: application/json -> text/plain -> application/octet-stream) This is a petgraph DiGraph, so you can walk the tree if needed.

The hash is a mapping between MIME types and nodes on the graph. The root of the graph is “all/all”, so start traversing there unless you need to jump to a particular node.

Fields

graph: DiGraph<String, u32>hash: FnvHashMap<String, NodeIndex>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.