pub fn create_or_update_session<F>(
        &mut self,
        discovery: DiscoveryProxy,
        id: u64,
        delta: SessionInfoDelta,
        create_fn: F,
    ) -> Result<(), Error>
    where
        F: Fn(DiscoveryProxy, u64) -> Result<SessionControlProxy, Error>,
    {
        self.map
            .entry(id)
            .or_insert({
                let session_proxy = create_fn(discovery, id)?;
                MediaState::new(session_proxy)
            })
            .update_session_info(delta);

        self.update_notification_responders();
        Ok(())
    }
/// If the entry, `id` doesn't exist in the map, create a `MediaState` entry
/// when the control proxy.
/// Update the state with the delta.
/// Update any outstanding notification responders with the change in state.
If the entry, `id` doesn't exist in the map, create a `MediaState` entry
when the control proxy.
Update the state with the delta.
Update any outstanding notification responders with the change in state.
If the entry ` id ` doesn ' t exist in the map create a ` MediaState ` entry when the control proxy . Update the state with the delta . Update any outstanding notification responders with the change in state .
pub fn create_or_update_session<F>(
        &mut self,
        discovery: DiscoveryProxy,
        id: u64,
        delta: SessionInfoDelta,
        create_fn: F,
    ) -> Result<(), Error>
    where
        F: Fn(DiscoveryProxy, u64) -> Result<SessionControlProxy, Error>,
    {
        self.map
            .entry(id)
            .or_insert({
                let session_proxy = create_fn(discovery, id)?;
                MediaState::new(session_proxy)
            })
            .update_session_info(delta);
        self.update_notification_responders();
        Ok(())
    }
pub fn create_or_update_session < F > ( & mut self , discovery : DiscoveryProxy , id : u64 , delta : SessionInfoDelta , create_fn : F , ) -> Result < ( ) , Error > where F : Fn ( DiscoveryProxy , u64 ) -> Result < SessionControlProxy , Error > , { self . map . entry ( id ) . or_insert ( { let session_proxy = create_fn ( discovery , id ) ? ; MediaState :: new ( session_proxy ) } ) . update_session_info ( delta ) ; self . update_notification_responders ( ) ; Ok ( ( ) ) }
If the entry, `id` doesn't exist in the map, create a `MediaState` entry
when the control proxy.
If the entry ` id ` doesn ' t exist in the map create a ` MediaState ` entry when the control proxy .
&mut self
discovery
DiscoveryProxy
id
u64
delta
SessionInfoDelta
create_fn
F