Struct conciliator::edit::TomlEditor
source · pub struct TomlEditor<T: Serialize + DeserializeOwned> { /* private fields */ }
Expand description
Wrapper type to Edit
something using TOML
Implements Editable
itself so it can be used explicitly like con.edit(TomlEditor::new(thing))
or, more conveniently, Editable
can be implemented for a particular type to wrap the type automatically when writing con.edit(thing)
.
To this end, the macro edit_as_toml
is provided.
Since this uses serde
, it requires the type to be Serialize
and DeserializeOwned
.
The trait bound is specifically DeserializeOwned
instead of Deserialize
because it has to outlive the content of the temporary file and cannot borrow from it.
Implementations§
source§impl<T: Serialize + DeserializeOwned> TomlEditor<T>
impl<T: Serialize + DeserializeOwned> TomlEditor<T>
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for TomlEditor<T>where
T: RefUnwindSafe,
impl<T> Send for TomlEditor<T>where
T: Send,
impl<T> Sync for TomlEditor<T>where
T: Sync,
impl<T> Unpin for TomlEditor<T>where
T: Unpin,
impl<T> UnwindSafe for TomlEditor<T>where
T: UnwindSafe,
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