Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make loaders public #33

Merged
merged 4 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ where
}
}

struct CsvAssetLoader<A> {
/// Loads your asset type `A` from csv files
pub struct CsvAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
delimiter: u8,
Expand Down
3 changes: 2 additions & 1 deletion src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ where
}
}

struct JsonAssetLoader<A> {
/// Loads your asset type `A` from json files
pub struct JsonAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
}
Expand Down
3 changes: 2 additions & 1 deletion src/msgpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ where
}
}

struct MsgPackAssetLoader<A> {
/// Loads your asset type `A` from `MessagePack` files
pub struct MsgPackAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
}
Expand Down
14 changes: 12 additions & 2 deletions src/postcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ where
}
}

struct PostcardAssetLoader<A> {
/// Loads your asset type `A` from `Postcard` files
pub struct PostcardAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
}
Expand Down Expand Up @@ -88,10 +89,19 @@ where
}
}

struct PostcardAssetSaver<A> {
/// Saves your asset type `A` to `Postcard` files
pub struct PostcardAssetSaver<A> {
_marker: PhantomData<A>,
}

impl<A> Default for PostcardAssetSaver<A> {
fn default() -> Self {
Self {
_marker: PhantomData,
}
}
}

impl<A: Asset + Serialize> AssetSaver for PostcardAssetSaver<A> {
type Asset = A;
type Settings = ();
Expand Down
3 changes: 2 additions & 1 deletion src/ron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ where
}
}

struct RonAssetLoader<A> {
/// Loads your asset type `A` from ron files
pub struct RonAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
}
Expand Down
3 changes: 2 additions & 1 deletion src/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ where
}
}

struct TomlAssetLoader<A> {
/// Loads your asset type `A` from toml files
pub struct TomlAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
}
Expand Down
3 changes: 2 additions & 1 deletion src/xml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ where
}
}

struct XmlAssetLoader<A> {
/// Loads your asset type `A` from xml files
pub struct XmlAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
}
Expand Down
3 changes: 2 additions & 1 deletion src/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ where
}
}

struct YamlAssetLoader<A> {
/// Loads your asset type `A` from yaml files
pub struct YamlAssetLoader<A> {
extensions: Vec<&'static str>,
_marker: PhantomData<A>,
}
Expand Down
Loading