[−][src]Struct structdoc::Documentation
A representation of documentation.
This carries the internal representation (tree) of a documentation. Note that currently this does not support cycles or referencing other branches.
This can be either queried by the StructDoc
trait, or manually constructed (which might be
needed in a manual implementation of the trait).
TODO
Currently, the documentation can be formatted both with the Debug
and
Display
traits, but doesn't offer any kind of customization. In the
future it should be possible to both traverse the structure manually and to customize the way
the documentation is formatted.
Implementations
impl Documentation
[src]
pub fn leaf_empty() -> Documentation
[src]
Creates a leaf node of the documentation, without any description.
pub fn leaf(ty: impl Into<Text>) -> Documentation
[src]
Creates a leaf node with the given type.
Note that an empty ty
is equivalent to the leaf_empty
.
pub fn set_flag(&mut self, flag: Flags)
[src]
Adds a flag to this documentation node.
pub fn with_arity(self, arity: Arity) -> Self
[src]
Wraps a node into an array or a set.
This describes a homogeneous collection.
pub fn map(key: Documentation, value: Documentation) -> Self
[src]
Builds a map.
Joins documentation of keys and values into a map. Note that all the keys and all the values are of the same type ‒ for heterogeneous things, you might want structs or enums.
pub fn struct_(
fields: impl IntoIterator<Item = (impl Into<Text>, Field)>
) -> Self
[src]
fields: impl IntoIterator<Item = (impl Into<Text>, Field)>
) -> Self
Builds a struct.
Builds a structure, provided a list of fields.
The iterator should yield pairs of (name, field).
pub fn enum_(
variants: impl IntoIterator<Item = (impl Into<Text>, Field)>,
tagging: Tagging
) -> Self
[src]
variants: impl IntoIterator<Item = (impl Into<Text>, Field)>,
tagging: Tagging
) -> Self
Builds an enum.
Builds an enum from provided list of fields. The fields may be either leaves (without
things inside ‒ created with eg. leaf_empty
), newtypes
(other leaves) or structs. The iterator should yield pairs of (name, variant).
See the serde documentation about enum
representations for tagging
.
Trait Implementations
impl Clone for Documentation
[src]
fn clone(&self) -> Documentation
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Documentation
[src]
impl Display for Documentation
[src]
Auto Trait Implementations
impl RefUnwindSafe for Documentation
impl Send for Documentation
impl Sync for Documentation
impl Unpin for Documentation
impl UnwindSafe for Documentation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,