Struct imgui::text_filter::TextFilter

source ·
pub struct TextFilter { /* private fields */ }
Expand description

Helper to parse and apply text filters

Implementations§

source§

impl TextFilter

source

pub fn new(label: String) -> Self

Creates a new TextFilter with an empty filter.

This is equivalent of new_with_filter with filter set to "".

source

pub fn new_with_filter(label: String, filter: String) -> Self

Creates a new TextFilter with a custom filter.

source

pub fn build(&self)

Builds the TextFilter with its filter attribute. You can use pass_filter() after it.

If you want control the filter with an InputText, check draw().

source

pub fn draw(&self)

Draws an InputText to control the filter of the TextFilter.

This is equivalent of draw_with_size with size set to 0.0.

source

pub fn draw_with_size(&self, size: f32)

Draws an InputText to control the filter of the TextFilter.

The InputText has the size passed in parameters.

source

pub fn is_active(&self) -> bool

Returns true if the filter is not empty ("").

source

pub fn pass_filter(&self, buf: &str) -> bool

Returns true if the buffer matches the filter.

draw() or build() mut be called before this function.

source

pub fn pass_filter_with_end(&self, start: &str, end: &str) -> bool

source

pub fn clear(&self)

Clears the filter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.