Skip to main content

InertPieceTrait

Trait InertPieceTrait 

Source
pub trait InertPieceTrait:
    PieceBaseTrait
    + Serialize
    + Deserialize {
    // Required methods
    fn svg(
        &self,
        f: &mut Html,
        id: VisiblePieceId,
        face: FaceId,
        xdata: &Option<Box<dyn PieceXData>>,
    ) -> Result<(), InternalError>;
    fn describe_html(&self, face: FaceId) -> Result<Html, InternalError>;
}

Required Methods§

Source

fn svg( &self, f: &mut Html, id: VisiblePieceId, face: FaceId, xdata: &Option<Box<dyn PieceXData>>, ) -> Result<(), InternalError>

When used for occultated version of another object, face used is always default, regardless of nfaces. This is always the case for a piece whose PieceSpec::load returns Some for occultation, but which does not provide a nontrivial PieceSpec::load_inert.

Source

fn describe_html(&self, face: FaceId) -> Result<Html, InternalError>

Trait Implementations§

Source§

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

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Box<dyn InertPieceTrait>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

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

Source§

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

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

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

Source§

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

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

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

Source§

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

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

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

Source§

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

Serialize this value into the given Serde serializer. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§