pub struct ConfigDocument { /* private fields */ }Expand description
A decrypted config document.
Implementations§
Source§impl ConfigDocument
impl ConfigDocument
Sourcepub fn format(&self) -> ConfigFormat
pub fn format(&self) -> ConfigFormat
The declared format.
Sourcepub fn expose(&self) -> &[u8] ⓘ
pub fn expose(&self) -> &[u8] ⓘ
The body, exactly as written: no newline, whitespace or encoding normalisation.
Sourcepub fn text(&self) -> Result<&str, Error>
pub fn text(&self) -> Result<&str, Error>
The body as text. Configs are checked for UTF-8 before they are written, so this fails only for a document written some other way.
Sourcepub fn deserialize<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn deserialize<T: DeserializeOwned>(&self) -> Result<T, Error>
Parse a toml or json body into a caller type. yaml and text
are refused: parse those yourself from ConfigDocument::expose.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigDocument
impl RefUnwindSafe for ConfigDocument
impl Send for ConfigDocument
impl Sync for ConfigDocument
impl Unpin for ConfigDocument
impl UnsafeUnpin for ConfigDocument
impl UnwindSafe for ConfigDocument
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