Struct egui_memory_editor::MemoryEditor [−][src]
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]
mut self: Self,
write_function: WriteFunction<T>
) -> Self
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]
mut self: Self,
range_name: impl Into<String>,
address_range: Range<usize>
) -> Self
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]
fn clone(&self) -> MemoryEditor<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for MemoryEditor<T>
[src]
impl<T> Send for MemoryEditor<T>
[src]
impl<T> Sync for MemoryEditor<T>
[src]
impl<T> Unpin for MemoryEditor<T>
[src]
impl<T> UnwindSafe for MemoryEditor<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,