Trait cdoc::config::Format

source ·
pub trait Format: DynClone + Debug + Send + Sync + Serialize + Deserialize {
    // Required methods
    fn extension(&self) -> &str;
    fn template_prefix(&self) -> &str;
    fn name(&self) -> &str;
    fn no_parse(&self) -> bool;
    fn renderer(&self) -> Box<dyn DocumentRenderer>;
    fn include_resources(&self) -> bool;
    fn use_layout(&self) -> bool;
}
Expand description

Implementors define a format. This trait should make format extensions easy to implement.

Required Methods§

source

fn extension(&self) -> &str

Return the file extension used for the given format.

source

fn template_prefix(&self) -> &str

Template format name. Useful if templates are reused across formats as is the case for notebooks which use markdown.

source

fn name(&self) -> &str

Format name that is used in status messages, build output and in the configuration file.

source

fn no_parse(&self) -> bool

Return true if the format should not be parsed. This may be removed in the future and is currently only used for the info format which exports all parsed contents in a project.

source

fn renderer(&self) -> Box<dyn DocumentRenderer>

Return a renderer instance. Currently does not allow for configuration.

source

fn include_resources(&self) -> bool

Determines whether non-source files should be copied to

source

fn use_layout(&self) -> bool

Trait Implementations§

source§

impl<'clone> Clone for Box<dyn Format + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn Format + Send + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn Format + Send + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn Format + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'de> Deserialize<'de> for Box<dyn Format>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'de> Deserialize<'de> for Box<dyn Format + Send>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'de> Deserialize<'de> for Box<dyn Format + Send + Sync>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'de> Deserialize<'de> for Box<dyn Format + Sync>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for dyn Format

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for dyn Format

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
source§

impl PartialEq<dyn Format> for dyn Format

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'typetag> Serialize for dyn Format + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'typetag> Serialize for dyn Format + Send + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'typetag> Serialize for dyn Format + Send + Sync + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'typetag> Serialize for dyn Format + Sync + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Strictest for dyn Format

§

type Object = dyn Format + Send + Sync

source§

impl Eq for dyn Format

Implementors§