pub struct ResourceID { /* private fields */ }
Implementations§
Source§impl ResourceID
impl ResourceID
pub fn new() -> Self
Sourcepub fn create_derived(&self, parameters: &str, extension: &str) -> ResourceID
pub fn create_derived(&self, parameters: &str, extension: &str) -> ResourceID
Create a derived ResourceID from a existing one. This nests the original ResourceID
let resource_id = ResourceID::from_str("[assembly:/_pro/_test/usern/materialclasses/ball_of_water_b.materialclass].pc_fx")?;
let derived = resource_id.create_derived("dx11", "mate");
assert_eq!(derived.resource_path(), "[[assembly:/_pro/_test/usern/materialclasses/ball_of_water_b.materialclass].fx](dx11).pc_mate");
Sourcepub fn create_aspect(&self, ids: Vec<&ResourceID>) -> ResourceID
pub fn create_aspect(&self, ids: Vec<&ResourceID>) -> ResourceID
Create a ResourceID with aspect parameters
let resource_id = ResourceID::from_str("[assembly:/templates/aspectdummy.aspect].pc_entitytype")?;
let sub_id_1 = ResourceID::from_str("[assembly:/_pro/effects/geometry/water.prim].pc_entitytype")?;
let sub_id_2 = ResourceID::from_str("[modules:/zdisablecameracollisionaspect.class].entitytype")?;
let aspect = resource_id.create_aspect(vec![&sub_id_1, &sub_id_2]);
assert_eq!(aspect.resource_path(), "[assembly:/templates/aspectdummy.aspect]([assembly:/_pro/effects/geometry/water.prim].entitytype,[modules:/zdisablecameracollisionaspect.class].entitytype).pc_entitytype");
pub fn add_parameter(&mut self, param: &str)
Sourcepub fn resource_path(&self) -> String
pub fn resource_path(&self) -> String
Get the resource path. Will append the platform tag
Sourcepub fn inner_most_resource_path(&self) -> ResourceID
pub fn inner_most_resource_path(&self) -> ResourceID
Get the base ResourceID within a derived ResourceID
let resource_id = ResourceID::from_str("[[[assembly:/_pro/_test/usern/materialclasses/ball_of_water_b.materialclass].fx](dx11).mate](dx12).pc_mate")?;
let inner_most_path = resource_id.inner_most_resource_path();
assert_eq!(inner_most_path.resource_path(), "[assembly:/_pro/_test/usern/materialclasses/ball_of_water_b.materialclass].pc_fx");
Sourcepub fn inner_resource_path(&self) -> ResourceID
pub fn inner_resource_path(&self) -> ResourceID
Get the base ResourceID within a derived ResourceID
let resource_id = ResourceID::from_str("[[[assembly:/_pro/_test/usern/materialclasses/ball_of_water_b.materialclass].fx](dx11).mate](dx12).pc_mate")?;
let inner_path = resource_id.inner_resource_path();
assert_eq!(inner_path.resource_path(), "[[assembly:/_pro/_test/usern/materialclasses/ball_of_water_b.materialclass].fx](dx11).pc_mate");
}
pub fn protocol(&self) -> Option<String>
pub fn parameters(&self) -> Vec<String>
pub fn path(&self) -> Option<String>
pub fn is_empty(&self) -> bool
pub fn is_valid(&self) -> bool
pub fn into_rrid(self) -> RuntimeResourceID
Trait Implementations§
Source§impl Clone for ResourceID
impl Clone for ResourceID
Source§fn clone(&self) -> ResourceID
fn clone(&self) -> ResourceID
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ResourceID
impl Debug for ResourceID
Source§impl Default for ResourceID
impl Default for ResourceID
Source§fn default() -> ResourceID
fn default() -> ResourceID
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResourceID
impl<'de> Deserialize<'de> for ResourceID
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<ResourceID> for RuntimeResourceID
impl From<ResourceID> for RuntimeResourceID
Source§fn from(value: ResourceID) -> Self
fn from(value: ResourceID) -> Self
Converts to this type from the input type.
Source§impl FromStr for ResourceID
impl FromStr for ResourceID
Source§impl Hash for ResourceID
impl Hash for ResourceID
Source§impl PartialEq for ResourceID
impl PartialEq for ResourceID
Source§impl Serialize for ResourceID
impl Serialize for ResourceID
impl Eq for ResourceID
impl StructuralPartialEq for ResourceID
Auto Trait Implementations§
impl Freeze for ResourceID
impl RefUnwindSafe for ResourceID
impl Send for ResourceID
impl Sync for ResourceID
impl Unpin for ResourceID
impl UnwindSafe for ResourceID
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more