[][src]Trait yy_boss::YyResource

pub trait YyResource: Serialize + for<'de> Deserialize<'de> + Clone + Default {
    type AssociatedData: Debug;

    const SUBPATH_NAME: &'static str;

    fn name(&self) -> &str;
fn set_name(&mut self, name: String);
fn parent_path(&self) -> ViewPath;
fn deserialize_associated_data(
        &self,
        project_directory: &Path
    ) -> Result<Option<Self::AssociatedData>>;
fn serialize_associated_data(
        &self,
        directory_path: &Path,
        data: &Self::AssociatedData
    ) -> Result<()>;
fn cleanup(
        &self,
        files_to_delete: &mut Vec<PathBuf>,
        folders_to_delete: &mut Vec<PathBuf>
    ); }

Associated Types

Loading content...

Associated Constants

const SUBPATH_NAME: &'static str

Loading content...

Required methods

fn name(&self) -> &str

Get's the resource's name.

fn set_name(&mut self, name: String)

Sets the name of the resource.

fn parent_path(&self) -> ViewPath

Get the path to the parent in the View Virtual File System.

fn deserialize_associated_data(
    &self,
    project_directory: &Path
) -> Result<Option<Self::AssociatedData>>

Deserialized the associated data with a given Yy File. In a sprite, for example, this would load the pngs into memory.

fn serialize_associated_data(
    &self,
    directory_path: &Path,
    data: &Self::AssociatedData
) -> Result<()>

Serialized the associated data with a given Yy File. In a sprite, for example, this would serialize the pngs.

fn cleanup(
    &self,
    files_to_delete: &mut Vec<PathBuf>,
    folders_to_delete: &mut Vec<PathBuf>
)

Loading content...

Implementations on Foreign Types

impl YyResource for Sprite[src]

type AssociatedData = Vec<(FrameId, ImageBuffer<Rgba<u8>, Vec<u8>>)>

Loading content...

Implementors

Loading content...