MCPcopy Create free account
hub / github.com/algoscienceacademy/RustUI / get_transition

Method get_transition

src/navigation/mod.rs:59–70  ·  view source on GitHub ↗
(&self, from: Option<&RouteType>, to: Option<&RouteType>)

Source from the content-addressed store, hash-verified

57 }
58
59 fn get_transition(&self, from: Option<&RouteType>, to: Option<&RouteType>) -> Box<dyn Transition> {
60 match (from, to) {
61 (Some(from), Some(to)) => {
62 if let Some(transition) = self.transitions.get(&(from.clone(), to.clone())) {
63 Box::new(DefaultTransition) // For now, return a new instance since we can't clone trait objects
64 } else {
65 Box::new(DefaultTransition)
66 }
67 }
68 _ => Box::new(DefaultTransition),
69 }
70 }
71
72 pub fn push(&mut self, route: Route) {
73 let transition = self.get_transition(

Callers 2

pushMethod · 0.80
popMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected