Struct yy_typings::ViewPathLocation
source · [−]pub struct ViewPathLocation(pub String);
Expand description
The path
component will always end with .yy, even if it describes
a virtual folder or file. Given the following Gms2 folder virtual system
(not operating system file system): ```txt
folders/
Sprites/
spr_enemy.yy
spr_player.yy
In this case, we would see the following `ViewPath`s, in Json form:
```json
[
{ "name": "spr_enemy", "path": "folders/Sprites/spr_enemy.yy" },
{ "name": "spr_player", "path": "folders/Sprites/spr_player.yy" }
]
NB the default provided here, a Blank String, is never correct in a Gms2 Project. Instead, to describe a file at the root of the project (ie, a file not inside a folder), please use: ```
use yy_typings::ViewPathLocation;
const PROJECT_NAME: &’static str = “A project Name”;
ViewPathLocation(format!(“{}.yyp”, PROJECT_NAME));
Tuple Fields
0: String
Implementations
sourceimpl ViewPathLocation
impl ViewPathLocation
pub fn new(s: impl Into<String>) -> Self
pub fn inner(&self) -> &str
pub fn root_folder() -> ViewPathLocation
pub fn root_file(project_name: &str) -> ViewPathLocation
Trait Implementations
sourceimpl Clone for ViewPathLocation
impl Clone for ViewPathLocation
sourcefn clone(&self) -> ViewPathLocation
fn clone(&self) -> ViewPathLocation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ViewPathLocation
impl Debug for ViewPathLocation
sourceimpl Default for ViewPathLocation
impl Default for ViewPathLocation
sourcefn default() -> ViewPathLocation
fn default() -> ViewPathLocation
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for ViewPathLocation
impl<'de> Deserialize<'de> for ViewPathLocation
sourcefn 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
sourceimpl Display for ViewPathLocation
impl Display for ViewPathLocation
sourceimpl From<ViewPathLocation> for String
impl From<ViewPathLocation> for String
sourcefn from(o: ViewPathLocation) -> Self
fn from(o: ViewPathLocation) -> Self
Converts to this type from the input type.
sourceimpl Hash for ViewPathLocation
impl Hash for ViewPathLocation
sourceimpl Ord for ViewPathLocation
impl Ord for ViewPathLocation
sourceimpl PartialEq<String> for ViewPathLocation
impl PartialEq<String> for ViewPathLocation
sourceimpl PartialEq<ViewPathLocation> for ViewPathLocation
impl PartialEq<ViewPathLocation> for ViewPathLocation
sourcefn eq(&self, other: &ViewPathLocation) -> bool
fn eq(&self, other: &ViewPathLocation) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ViewPathLocation) -> bool
fn ne(&self, other: &ViewPathLocation) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ViewPathLocation> for ViewPathLocation
impl PartialOrd<ViewPathLocation> for ViewPathLocation
sourcefn partial_cmp(&self, other: &ViewPathLocation) -> Option<Ordering>
fn partial_cmp(&self, other: &ViewPathLocation) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for ViewPathLocation
impl Serialize for ViewPathLocation
impl Eq for ViewPathLocation
impl StructuralEq for ViewPathLocation
impl StructuralPartialEq for ViewPathLocation
Auto Trait Implementations
impl RefUnwindSafe for ViewPathLocation
impl Send for ViewPathLocation
impl Sync for ViewPathLocation
impl Unpin for ViewPathLocation
impl UnwindSafe for ViewPathLocation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more