pub struct ServicesViewMut<'a> { /* private fields */ }Expand description
Mutable view: same reads plus add/remove/replace.
Implementations§
Source§impl<'a> ServicesViewMut<'a>
impl<'a> ServicesViewMut<'a>
pub fn new(node: &'a mut Node) -> Self
pub fn service_types(&self) -> Vec<String>
pub fn has_service(&self, type_sym: &str) -> bool
Sourcepub fn add_service(
&mut self,
type_sym: &str,
config_source: Option<&str>,
) -> Result<(), Error>
pub fn add_service( &mut self, type_sym: &str, config_source: Option<&str>, ) -> Result<(), Error>
Builds (service <sym>) or (service <sym> <config>) and adds
it to the blessed shape. A bare base symbol is rewritten to
(append (list (service <sym>)) <base>); cons promotes to
cons*.
Sourcepub fn remove_service(&mut self, type_sym: &str) -> Result<(), Error>
pub fn remove_service(&mut self, type_sym: &str) -> Result<(), Error>
Removes the element with attached leading trivia. A cons/cons*
left with only its tail collapses to (cons* <tail>) (single-arg
cons* is identity; a one-arg cons would be invalid Scheme).
Sourcepub fn replace_service_type(&mut self, old: &str, new: &str) -> bool
pub fn replace_service_type(&mut self, old: &str, new: &str) -> bool
Swaps just the type symbol; a config argument is preserved.
Auto Trait Implementations§
impl<'a> !UnwindSafe for ServicesViewMut<'a>
impl<'a> Freeze for ServicesViewMut<'a>
impl<'a> RefUnwindSafe for ServicesViewMut<'a>
impl<'a> Send for ServicesViewMut<'a>
impl<'a> Sync for ServicesViewMut<'a>
impl<'a> Unpin for ServicesViewMut<'a>
impl<'a> UnsafeUnpin for ServicesViewMut<'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