pub trait EntryBufferImpl: EntryBufferImplExt + ObjectImpl {
    // Provided methods
    fn delete_text(&self, position: u32, n_chars: Option<u32>) -> u32 { ... }
    fn deleted_text(&self, position: u32, n_chars: Option<u32>) { ... }
    fn length(&self) -> u32 { ... }
    fn text(&self) -> GString { ... }
    fn insert_text(&self, position: u32, chars: &str) -> u32 { ... }
    fn inserted_text(&self, position: u32, chars: &str) { ... }
}

Provided Methods§

source

fn delete_text(&self, position: u32, n_chars: Option<u32>) -> u32

Deletes a sequence of characters from the buffer.

@n_chars characters are deleted starting at @position. If @n_chars is negative, then all characters until the end of the text are deleted.

If @position or @n_chars are out of bounds, then they are coerced to sane values.

Note that the positions are specified in characters, not bytes.

position

position at which to delete text

n_chars

number of characters to delete

Returns

The number of characters deleted.

source

fn deleted_text(&self, position: u32, n_chars: Option<u32>)

source

fn length(&self) -> u32

Retrieves the length in characters of the buffer.

Returns

The number of characters in the buffer.

source

fn text(&self) -> GString

source

fn insert_text(&self, position: u32, chars: &str) -> u32

Inserts @n_chars characters of @chars into the contents of the buffer, at position @position.

If @n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If @position or @n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.

Note that the position and length are in characters, not in bytes.

position

the position at which to insert text.

chars

the text to insert into the buffer.

n_chars

the length of the text in characters, or -1

Returns

The number of characters actually inserted.

source

fn inserted_text(&self, position: u32, chars: &str)

Implementors§