pub struct PackageSerializer;Expand description
Package serializer/deserializer
Implementations§
Source§impl PackageSerializer
impl PackageSerializer
Sourcepub fn load_from_file(path: &Path) -> Result<Package, RezCoreError>
pub fn load_from_file(path: &Path) -> Result<Package, RezCoreError>
Load a package from a file
Sourcepub fn load_from_string(
content: &str,
format: PackageFormat,
) -> Result<Package, RezCoreError>
pub fn load_from_string( content: &str, format: PackageFormat, ) -> Result<Package, RezCoreError>
Load a package from a string
Sourcepub fn load_from_yaml(content: &str) -> Result<Package, RezCoreError>
pub fn load_from_yaml(content: &str) -> Result<Package, RezCoreError>
Load a package from YAML content
Sourcepub fn load_from_json(content: &str) -> Result<Package, RezCoreError>
pub fn load_from_json(content: &str) -> Result<Package, RezCoreError>
Load a package from JSON content
Sourcepub fn load_from_python(content: &str) -> Result<Package, RezCoreError>
pub fn load_from_python(content: &str) -> Result<Package, RezCoreError>
Load a package from Python content using advanced AST parsing
Sourcepub fn save_to_file(
package: &Package,
path: &Path,
format: PackageFormat,
) -> Result<(), RezCoreError>
pub fn save_to_file( package: &Package, path: &Path, format: PackageFormat, ) -> Result<(), RezCoreError>
Save a package to a file
Sourcepub fn save_to_string(
package: &Package,
format: PackageFormat,
) -> Result<String, RezCoreError>
pub fn save_to_string( package: &Package, format: PackageFormat, ) -> Result<String, RezCoreError>
Save a package to a string
Sourcepub fn save_to_yaml(package: &Package) -> Result<String, RezCoreError>
pub fn save_to_yaml(package: &Package) -> Result<String, RezCoreError>
Save a package to YAML format
Sourcepub fn save_to_json(package: &Package) -> Result<String, RezCoreError>
pub fn save_to_json(package: &Package) -> Result<String, RezCoreError>
Save a package to JSON format
Sourcepub fn save_to_python(package: &Package) -> Result<String, RezCoreError>
pub fn save_to_python(package: &Package) -> Result<String, RezCoreError>
Save a package to Python format (simplified)
Auto Trait Implementations§
impl Freeze for PackageSerializer
impl RefUnwindSafe for PackageSerializer
impl Send for PackageSerializer
impl Sync for PackageSerializer
impl Unpin for PackageSerializer
impl UnwindSafe for PackageSerializer
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> 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