pub enum PluginOp {
Keep(usize),
Modify(usize, DirectiveWrapper),
Insert(DirectiveWrapper),
Delete(usize),
}Expand description
One operation in a PluginOutput’s ordered op list.
Ops describe how each output directive relates to the input:
PluginOp::Keep— reuseinput[i]unchanged. Span andfile_idpreserved.PluginOp::Modify— output a new wrapper, but inheritinput[i]’s source identity (span /file_id). Plugins use this when transforming an existing directive’s content (e.g., adding tags) so error reporting still points at the original source location.PluginOp::Insert— emit a fresh directive with synthesized source location (SYNTHESIZED_FILE_ID, zero span). Use for directives the plugin invents from scratch.PluginOp::Delete— dropinput[i]. Must be explicit; omitting an index withoutDeleteis a protocol violation that the host reports as a plugin error.
Variants§
Keep(usize)
Reuse input[i] unchanged (preserves original span + file_id).
Modify(usize, DirectiveWrapper)
Replace input[i]’s content with wrapper, but inherit
input[i]’s source identity (span + file_id).
Insert(DirectiveWrapper)
Insert a fresh directive with synthesized source location.
Delete(usize)
Drop input[i]. Must be explicit — see type-level docs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PluginOp
impl<'de> Deserialize<'de> for PluginOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PluginOp
impl RefUnwindSafe for PluginOp
impl Send for PluginOp
impl Sync for PluginOp
impl Unpin for PluginOp
impl UnsafeUnpin for PluginOp
impl UnwindSafe for PluginOp
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