pub struct Prefixed<'a>(/* private fields */);Expand description
Helper structure to work with prefixed environment variables more efficiently.
This struct provides methods for serializing and deserializing data with a consistent prefix.
Use the prefixed function to create an instance of this struct.
Implementations§
Source§impl<'a> Prefixed<'a>
impl<'a> Prefixed<'a>
pub fn from_env<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn from_str<T>(&self, input: &'a str) -> Result<T, Error>where
T: DeserializeOwned,
pub fn from_reader<R, T>(&self, reader: R) -> Result<T, Error>where
R: Read,
T: DeserializeOwned,
pub fn from_file<T>(&self, path: &Path) -> Result<T, Error>where
T: DeserializeOwned,
pub fn to_string<T>(&self, v: &T) -> Result<String, Error>where
T: Serialize,
pub fn to_writer<W, T>(&self, writer: W, v: &T) -> Result<(), Error>
pub fn to_file<P, T>(&self, path: P, v: &T) -> Result<(), Error>
Auto Trait Implementations§
impl<'a> Freeze for Prefixed<'a>
impl<'a> RefUnwindSafe for Prefixed<'a>
impl<'a> Send for Prefixed<'a>
impl<'a> Sync for Prefixed<'a>
impl<'a> Unpin for Prefixed<'a>
impl<'a> UnwindSafe for Prefixed<'a>
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