pub struct Fence { /* private fields */ }Expand description
The markers one run quotes untrusted text inside.
The suffix is generated per run rather than fixed, so the marker cannot be guessed and written into a comment or a pull request title ahead of time. It is a second lock rather than the only one: every line that reads as a marker is stripped from quoted text whatever suffix it carries.
Implementations§
Source§impl Fence
impl Fence
pub fn new() -> Self
Sourcepub fn wrap(&self, what: &str, text: &str) -> String
pub fn wrap(&self, what: &str, text: &str) -> String
Quote a block of untrusted text under a label of its own.
Sourcepub fn comment(&self, p: &Pending) -> String
pub fn comment(&self, p: &Pending) -> String
One comment as a prompt carries it, fenced so its own text cannot close the fence around it.
A body containing a line that looks like the marker would otherwise end its own block and put whatever follows outside the quoted region, where it reads as instruction. The diff hunk is stripped too: it is code from the pull request, which its author controls.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fence
impl RefUnwindSafe for Fence
impl Send for Fence
impl Sync for Fence
impl Unpin for Fence
impl UnsafeUnpin for Fence
impl UnwindSafe for Fence
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