pub struct Strip { /* private fields */ }Expand description
Stripping mode for PluginHandle::strip.
Implementations§
Source§impl Strip
impl Strip
Sourcepub const fn new() -> Strip
pub const fn new() -> Strip
Creates a new Strip that, by default, strips no attributes.
§Examples
use hexchat_unsafe_plugin::{PluginHandle, Strip};
fn strip_nothing(s: &str, ph: &PluginHandle<'_>) -> String {
ph.strip(s, Strip::new())
}Sourcepub const fn colors(self, strip: bool) -> Self
pub const fn colors(self, strip: bool) -> Self
Sets whether to remove mIRC color attributes.
§Examples
use hexchat_unsafe_plugin::{PluginHandle, Strip};
fn strip_colors(s: &str, ph: &PluginHandle<'_>) -> String {
ph.strip(s, Strip::new().colors(true))
}Sourcepub const fn formatting(self, strip: bool) -> Self
pub const fn formatting(self, strip: bool) -> Self
Sets whether to remove formatting attributes.
§Examples
use hexchat_unsafe_plugin::{PluginHandle, Strip};
fn strip_formatting(s: &str, ph: &PluginHandle<'_>) -> String {
ph.strip(s, Strip::new().formatting(true))
}Sets whether to remove internal “hidden text” formatting attributes.
This is split from Self::formatting because these attributes are
only processed when writing directly to a buffer - they’re for
internal/plugin use. This tends to be useful when processing user or
remote input and writing it directly to a buffer.
§Examples
use hexchat_unsafe_plugin::{PluginHandle, Strip};
fn strip_hidden(s: &str, ph: &PluginHandle<'_>) -> String {
ph.strip(s, Strip::new().hidden(true))
}Trait Implementations§
impl Copy for Strip
impl Eq for Strip
impl StructuralPartialEq for Strip
Auto Trait Implementations§
impl Freeze for Strip
impl RefUnwindSafe for Strip
impl Send for Strip
impl Sync for Strip
impl Unpin for Strip
impl UnwindSafe for Strip
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