[][src]Trait yy_boss::YyResource

pub trait YyResource: Serialize + for<'de> Deserialize<'de> {
    type AssociatedData: Debug;
    type SharedData: Debug;
    fn name(&self) -> &str;
fn set_name(&mut self, name: String);
fn filesystem_path(&self) -> FilesystemPath;
fn parent_path(&self) -> ViewPath;
fn load_associated_data(
        &self,
        project_directory: &Path
    ) -> Result<Option<Self::AssociatedData>>;
fn serialize_associated_data(
        &self,
        directory_path: &Path,
        data: &Self::AssociatedData
    ) -> Result<()>;
fn load_shared_data(
        project_directory: &Path
    ) -> Result<Option<Self::SharedData>>;
fn serialize_shared_data(
        project_directory: &Path,
        shared_data: &Self::SharedData
    ) -> Result<()>; }

Associated Types

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 filesystem_path(&self) -> FilesystemPath

Get the relative filepath from the directory of the YYP to the resource yy file. For a sprite called spr_player, that path would be sprites/spr_player/spr_player.yy.

fn parent_path(&self) -> ViewPath

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

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

fn load_shared_data(
    project_directory: &Path
) -> Result<Option<Self::SharedData>>

fn serialize_shared_data(
    project_directory: &Path,
    shared_data: &Self::SharedData
) -> Result<()>

Loading content...

Implementations on Foreign Types

impl YyResource for Sprite[src]

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

type SharedData = BTreeMap<String, FilesystemPath>

Loading content...

Implementors

Loading content...