pub enum PsbValueFixed {
Show 17 variants
None,
Null,
Bool(bool),
Number(PsbNumber),
IntArray(PsbUintArray),
String(PsbString),
List(PsbListFixed),
Object(PsbObjectFixed),
Resource(PsbResourceRef),
ExtraResource(PsbExtraRef),
CompilerNumber,
CompilerString,
CompilerResource,
CompilerDecimal,
CompilerArray,
CompilerBool,
CompilerBinaryTree,
}emote-psb only.Expand description
Represents of a PSB value.
Variants§
None
No value.
Null
Represents a null value.
Bool(bool)
Represents a boolean value.
Number(PsbNumber)
Represents a number value.
IntArray(PsbUintArray)
Represents an array of integers.
String(PsbString)
Represents a string value.
List(PsbListFixed)
Represents a list of PSB values.
Object(PsbObjectFixed)
Represents an object with key-value pairs.
Resource(PsbResourceRef)
Represents a resource reference.
ExtraResource(PsbExtraRef)
Represents an extra resource reference.
CompilerNumber
Represents a compiler number.
CompilerString
Represents a compiler string.
CompilerResource
Represents a compiler resource.
CompilerDecimal
Represents a compiler decimal.
CompilerArray
Represents a compiler array.
CompilerBool
Represents a compiler boolean.
CompilerBinaryTree
Represents a compiler binary tree.
Implementations§
Source§impl PsbValueFixed
impl PsbValueFixed
Sourcepub fn to_psb(self, warn_on_none: bool) -> PsbValue
pub fn to_psb(self, warn_on_none: bool) -> PsbValue
Converts this value to original PSB value type.
Sourcepub fn is_string_or_null(&self) -> bool
pub fn is_string_or_null(&self) -> bool
Returns true if this value is a string or null.
Sourcepub fn find_resource_key<'a>(
&'a self,
resource_id: u64,
now: Vec<&'a str>,
) -> Option<Vec<&'a str>>
pub fn find_resource_key<'a>( &'a self, resource_id: u64, now: Vec<&'a str>, ) -> Option<Vec<&'a str>>
Find the resource’s key in object
Sourcepub fn find_extra_resource_key<'a>(
&'a self,
extra_resource_id: u64,
now: Vec<&'a str>,
) -> Option<Vec<&'a str>>
pub fn find_extra_resource_key<'a>( &'a self, extra_resource_id: u64, now: Vec<&'a str>, ) -> Option<Vec<&'a str>>
Find the extra resource’s key in object
Sourcepub fn set_obj(&mut self, value: PsbObjectFixed)
pub fn set_obj(&mut self, value: PsbObjectFixed)
Sets the value of this PSB value to a new object
Sourcepub fn set_string(&mut self, value: String)
pub fn set_string(&mut self, value: String)
Sets the value of this PSB value to a new string.
Sourcepub fn entries(&self) -> ObjectIter<'_> ⓘ
pub fn entries(&self) -> ObjectIter<'_> ⓘ
Returns a iterator over the entries of an object.
Sourcepub fn entries_mut(&mut self) -> ObjectIterMut<'_> ⓘ
pub fn entries_mut(&mut self) -> ObjectIterMut<'_> ⓘ
Returns a mutable iterator over the entries of an object.
Sourcepub fn members_mut(&mut self) -> ListIterMut<'_> ⓘ
pub fn members_mut(&mut self) -> ListIterMut<'_> ⓘ
Returns a mutable iterator over the members of a list.
Sourcepub fn push_member<T: Into<PsbValueFixed>>(&mut self, value: T)
pub fn push_member<T: Into<PsbValueFixed>>(&mut self, value: T)
Pushes a new member to a list. If this value is not a list, it will be converted to a list.
Sourcepub fn clear_members(&mut self)
pub fn clear_members(&mut self)
Clears all members in a list. If this value is not a list, it will be converted to an empty list.
Sourcepub fn insert_member<T: Into<PsbValueFixed>>(&mut self, index: usize, value: T)
pub fn insert_member<T: Into<PsbValueFixed>>(&mut self, index: usize, value: T)
Inserts a new member at the specified index in a list. If this value is not a list, it will be converted to a list. If the index is out of bounds, the value will be appended to the end of the list.
Sourcepub fn resource_id(&self) -> Option<u64>
pub fn resource_id(&self) -> Option<u64>
Returns the resource ID if this value is a resource reference.
Sourcepub fn extra_resource_id(&self) -> Option<u64>
pub fn extra_resource_id(&self) -> Option<u64>
Returns the extra resource ID if this value is an extra resource reference.
Trait Implementations§
Source§impl Clone for PsbValueFixed
impl Clone for PsbValueFixed
Source§impl Debug for PsbValueFixed
impl Debug for PsbValueFixed
Source§impl<'de> Deserialize<'de> for PsbValueFixed
impl<'de> Deserialize<'de> for PsbValueFixed
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>,
Source§impl From<&[PsbValueFixed]> for PsbValueFixed
impl From<&[PsbValueFixed]> for PsbValueFixed
Source§fn from(value: &[PsbValueFixed]) -> Self
fn from(value: &[PsbValueFixed]) -> Self
Source§impl From<PsbListFixed> for PsbValueFixed
impl From<PsbListFixed> for PsbValueFixed
Source§fn from(value: PsbListFixed) -> Self
fn from(value: PsbListFixed) -> Self
Source§impl From<PsbObjectFixed> for PsbValueFixed
impl From<PsbObjectFixed> for PsbValueFixed
Source§fn from(value: PsbObjectFixed) -> Self
fn from(value: PsbObjectFixed) -> Self
Source§impl From<String> for PsbValueFixed
impl From<String> for PsbValueFixed
Source§impl From<bool> for PsbValueFixed
impl From<bool> for PsbValueFixed
Source§impl From<f32> for PsbValueFixed
impl From<f32> for PsbValueFixed
Source§impl From<f64> for PsbValueFixed
impl From<f64> for PsbValueFixed
Source§impl From<i64> for PsbValueFixed
impl From<i64> for PsbValueFixed
Source§impl<'a> Index<&'a String> for PsbValueFixed
impl<'a> Index<&'a String> for PsbValueFixed
Source§impl<'a> Index<&'a str> for PsbValueFixed
impl<'a> Index<&'a str> for PsbValueFixed
Source§impl Index<String> for PsbValueFixed
impl Index<String> for PsbValueFixed
Source§impl Index<usize> for PsbValueFixed
impl Index<usize> for PsbValueFixed
Source§impl IndexMut<&String> for PsbValueFixed
impl IndexMut<&String> for PsbValueFixed
Source§impl IndexMut<&str> for PsbValueFixed
impl IndexMut<&str> for PsbValueFixed
Source§impl IndexMut<String> for PsbValueFixed
impl IndexMut<String> for PsbValueFixed
Source§impl IndexMut<usize> for PsbValueFixed
impl IndexMut<usize> for PsbValueFixed
Source§impl<'a> PartialEq<&'a str> for PsbValueFixed
impl<'a> PartialEq<&'a str> for PsbValueFixed
Source§impl PartialEq<String> for PsbValueFixed
impl PartialEq<String> for PsbValueFixed
Source§impl PartialEq<str> for PsbValueFixed
impl PartialEq<str> for PsbValueFixed
Auto Trait Implementations§
impl Freeze for PsbValueFixed
impl RefUnwindSafe for PsbValueFixed
impl Send for PsbValueFixed
impl Sync for PsbValueFixed
impl Unpin for PsbValueFixed
impl UnwindSafe for PsbValueFixed
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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