Any(Inner|Outer)ViewPort: make inner public

This commit is contained in:
Michael Sippel 2024-03-15 19:19:37 +01:00
parent 5becc11bf9
commit 5e441c9441
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -107,6 +107,7 @@ where V::Msg: Clone
pub fn attach_to_port(&self, other_port: ViewPort<V>) { pub fn attach_to_port(&self, other_port: ViewPort<V>) {
self.set_view( other_port.view.read().unwrap().clone() ); self.set_view( other_port.view.read().unwrap().clone() );
other_port.add_observer( self.cast.clone() ); other_port.add_observer( self.cast.clone() );
// todo: forward reset() ?
self.update_hooks.write().unwrap().clear(); self.update_hooks.write().unwrap().clear();
self.add_update_hook( Arc::new(other_port) ); self.add_update_hook( Arc::new(other_port) );
@ -303,10 +304,10 @@ impl<V: View + ?Sized + 'static> From<ViewPort<V>> for AnyViewPort {
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>> //<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
#[derive(Clone)] #[derive(Clone)]
pub struct AnyOuterViewPort(AnyViewPort); pub struct AnyOuterViewPort(pub AnyViewPort);
#[derive(Clone)] #[derive(Clone)]
pub struct AnyInnerViewPort(AnyViewPort); pub struct AnyInnerViewPort(pub AnyViewPort);
impl AnyOuterViewPort { impl AnyOuterViewPort {
pub fn downcast<V: View + ?Sized + 'static>(self) -> Result<OuterViewPort<V>, AnyViewPort> pub fn downcast<V: View + ?Sized + 'static>(self) -> Result<OuterViewPort<V>, AnyViewPort>