Enum prc::param::ParamKind [−][src]
The central data structure to param files and params. Similar to tree-like recursive data formats such as JSON.
Variants
Bool(bool)
I8(i8)
U8(u8)
I16(i16)
U16(u16)
I32(i32)
U32(u32)
Float(f32)
Hash(Hash40)
Str(String)
List(ParamList)
Struct(ParamStruct)
Implementations
impl ParamKind
[src]
pub fn try_into_owned<T>(self) -> Result<T, T::Error> where
T: TryFrom<ParamKind>,
[src]
T: TryFrom<ParamKind>,
Attempts to convert an owned param into the contained value. Returns an error if the contained value is not the expected type.
pub fn try_into_ref<'a, T>(
&'a self
) -> Result<&'a T, <&'a T as TryFrom<&'a ParamKind>>::Error> where
&'a T: TryFrom<&'a ParamKind>,
[src]
&'a self
) -> Result<&'a T, <&'a T as TryFrom<&'a ParamKind>>::Error> where
&'a T: TryFrom<&'a ParamKind>,
Attempts to convert a param by reference into a reference of the contained value. Returns an error if the contained value is not the expected type.
pub fn try_into_mut<'a, T>(
&'a mut self
) -> Result<&'a mut T, <&'a mut T as TryFrom<&'a mut ParamKind>>::Error> where
&'a mut T: TryFrom<&'a mut ParamKind>,
[src]
&'a mut self
) -> Result<&'a mut T, <&'a mut T as TryFrom<&'a mut ParamKind>>::Error> where
&'a mut T: TryFrom<&'a mut ParamKind>,
Attempts to convert a param by mutable reference into a mutable reference of the contained value. Returns an error if the contained value is not the expected type.
pub fn unwrap_as_hashmap(self) -> HashMap<Hash40, ParamKind>
[src]
Converts an owned param into a HashMap, indexing into the contained params. Panics if the param was not a ParamKind::Struct.
pub fn unwrap_as_hashmap_ref(&self) -> HashMap<Hash40, &ParamKind>
[src]
Converts a reference to a param into a HashMap, indexing into references to the contained params. Panics if the param was not a ParamKind::Struct.
pub fn unwrap_as_hashmap_mut(&mut self) -> HashMap<Hash40, &mut ParamKind>
[src]
Converts a mutable reference to a param into a HashMap, indexing into mutable references to the contained params. Panics if the param was not a ParamKind::Struct.
Trait Implementations
impl Clone for ParamKind
[src]
impl Debug for ParamKind
[src]
impl<'de> Deserialize<'de> for ParamKind
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<Hash40> for ParamKind
[src]
impl From<ParamList> for ParamKind
[src]
impl From<ParamStruct> for ParamKind
[src]
fn from(v: ParamStruct) -> ParamKind
[src]
impl From<String> for ParamKind
[src]
impl From<bool> for ParamKind
[src]
impl From<f32> for ParamKind
[src]
impl From<i16> for ParamKind
[src]
impl From<i32> for ParamKind
[src]
impl From<i8> for ParamKind
[src]
impl From<u16> for ParamKind
[src]
impl From<u32> for ParamKind
[src]
impl From<u8> for ParamKind
[src]
impl PartialEq<ParamKind> for ParamKind
[src]
impl Serialize for ParamKind
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for ParamKind
[src]
impl<'a> TryFrom<&'a ParamKind> for &'a ParamList
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_from(param: &'a ParamKind) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a ParamKind> for &'a ParamStruct
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_from(param: &'a ParamKind) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a mut ParamKind> for &'a mut ParamList
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_from(param: &'a mut ParamKind) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a mut ParamKind> for &'a mut ParamStruct
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_from(param: &'a mut ParamKind) -> Result<Self, Self::Error>
[src]
impl TryFrom<ParamKind> for ParamList
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_from(param: ParamKind) -> Result<Self, Self::Error>
[src]
impl TryFrom<ParamKind> for ParamStruct
[src]
Auto Trait Implementations
impl RefUnwindSafe for ParamKind
[src]
impl Send for ParamKind
[src]
impl Sync for ParamKind
[src]
impl Unpin for ParamKind
[src]
impl UnwindSafe for ParamKind
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,