Struct egui_memory_editor::MemoryEditor[][src]

pub struct MemoryEditor<T> {
    pub options: MemoryEditorOptions,
    // some fields omitted
}

The main struct for the editor window. This should persist between frames as it keeps track of quite a bit of state.

Fields

options: MemoryEditorOptions

A collection of options relevant for the MemoryEditor window. Can optionally be serialized/deserialized with serde

Implementations

impl<T> MemoryEditor<T>[src]

pub fn new(read_function: ReadFunction<T>) -> Self[src]

Create the MemoryEditor, which should be kept in memory between frames.

The read_function should return one u8 value from the object which you provide in either the Self::window_ui or the Self::draw_editor_contents method.

let mut memory_base = vec![0xFF; 0xFF];
let mut memory_editor: MemoryEditor<Vec<u8>> = MemoryEditor::new(|memory, address| memory[address]);

pub fn window_ui(&mut self, ctx: &CtxRef, memory: &mut T)[src]

Create a window and render the memory editor contents within.

If you want to make your own window/container to be used for the editor contents, you can use Self::draw_editor_contents.

pub fn draw_editor_contents(&mut self, ui: &mut Ui, memory: &mut T)[src]

Draws the actual memory viewer/editor.

Can be included in whatever container you want.

Use Self::window_ui if you want to have a window with the contents instead.

pub fn with_window_title(mut self: Self, title: impl Into<String>) -> Self[src]

Set the window title, only relevant if using the window_ui() call.

pub fn with_write_function(
    mut self: Self,
    write_function: WriteFunction<T>
) -> Self
[src]

Set the function used to write to the provided object T.

This will give the UI write capabilities, and will therefore no longer be read_only.

#[must_use]pub fn with_address_range(
    mut self: Self,
    range_name: impl Into<String>,
    address_range: Range<usize>
) -> Self
[src]

Add an address range to the range list. Multiple address ranges can be added, and will be displayed in the UI by a drop-down box if more than one range was added.

The first range that is added will be displayed by default when launching the UI.

The UI will query your set read_function with the values within this Range

pub fn with_options(mut self: Self, options: MemoryEditorOptions) -> Self[src]

Set the memory options, useful if you use the persistence feature.

Trait Implementations

impl<T: Clone> Clone for MemoryEditor<T>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.