Skip to content

Adding and removing a lone view #12

@j-gn

Description

@j-gn

Adding and removing a single view returns an error.
It seems a bit unclear if this is intentional since the documentation hints that a lone root would be problematic.

let mut test_mux = Mux::new();
let node1 = test_mux.add_below(DummyView, test_mux.root).unwrap();
print_tree(&test_mux);
let result = test_mux.remove_id(node1);
println!("{result:?}");
Current Tree: 1,2,
Err(Generic)

Reference

/// Removes the given id from the multiplexer, returns an error if not a valid id contained in the tree or the lone root of the tree.
/// When successful the Id of the removed Node is returned.
pub fn remove_id(&mut self, id: Id) -> Result<Id, RemoveViewError>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions