pub struct LegacyConverter;Expand description
Legacy format converter
Provides conversion between legacy formats (JSON, YAML, TOML) and DrivenConfig.
Implementations§
Source§impl LegacyConverter
impl LegacyConverter
Sourcepub fn from_json(content: &str) -> Result<DrivenConfig>
pub fn from_json(content: &str) -> Result<DrivenConfig>
Parse DrivenConfig from JSON string
Sourcepub fn to_json(config: &DrivenConfig) -> Result<String>
pub fn to_json(config: &DrivenConfig) -> Result<String>
Serialize DrivenConfig to JSON string
Sourcepub fn to_json_compact(config: &DrivenConfig) -> Result<String>
pub fn to_json_compact(config: &DrivenConfig) -> Result<String>
Serialize DrivenConfig to compact JSON string
Sourcepub fn from_yaml(content: &str) -> Result<DrivenConfig>
pub fn from_yaml(content: &str) -> Result<DrivenConfig>
Parse DrivenConfig from YAML string
Sourcepub fn to_yaml(config: &DrivenConfig) -> Result<String>
pub fn to_yaml(config: &DrivenConfig) -> Result<String>
Serialize DrivenConfig to YAML string
Sourcepub fn from_toml(content: &str) -> Result<DrivenConfig>
pub fn from_toml(content: &str) -> Result<DrivenConfig>
Parse DrivenConfig from TOML string
Sourcepub fn to_toml(config: &DrivenConfig) -> Result<String>
pub fn to_toml(config: &DrivenConfig) -> Result<String>
Serialize DrivenConfig to TOML string
Sourcepub fn from_auto(content: &str, path: &Path) -> Result<DrivenConfig>
pub fn from_auto(content: &str, path: &Path) -> Result<DrivenConfig>
Parse DrivenConfig from content with auto-detected format
The format is detected from the file path extension.
Sourcepub fn from_format(content: &str, format: LegacyFormat) -> Result<DrivenConfig>
pub fn from_format(content: &str, format: LegacyFormat) -> Result<DrivenConfig>
Parse DrivenConfig from content with specified format
Sourcepub fn to_format(config: &DrivenConfig, format: LegacyFormat) -> Result<String>
pub fn to_format(config: &DrivenConfig, format: LegacyFormat) -> Result<String>
Serialize DrivenConfig to string with specified format
Sourcepub fn load_file(path: &Path) -> Result<DrivenConfig>
pub fn load_file(path: &Path) -> Result<DrivenConfig>
Load DrivenConfig from a legacy format file
Sourcepub fn save_file(config: &DrivenConfig, path: &Path) -> Result<()>
pub fn save_file(config: &DrivenConfig, path: &Path) -> Result<()>
Save DrivenConfig to a legacy format file
The format is detected from the file path extension.
Sourcepub fn convert(
content: &str,
from_format: LegacyFormat,
to_format: LegacyFormat,
) -> Result<String>
pub fn convert( content: &str, from_format: LegacyFormat, to_format: LegacyFormat, ) -> Result<String>
Convert content from one legacy format to another
Auto Trait Implementations§
impl Freeze for LegacyConverter
impl RefUnwindSafe for LegacyConverter
impl Send for LegacyConverter
impl Sync for LegacyConverter
impl Unpin for LegacyConverter
impl UnsafeUnpin for LegacyConverter
impl UnwindSafe for LegacyConverter
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.