pub fn insert(&mut self, event: Event<N>) -> Result<EventRef<N>, Error> {
        let hash = compute_hash(&event).map_err(Error::Hash)?;
        let index = match self.indices.entry(hash) {
            Entry::Occupied(entry) => *entry.get(),
            Entry::Vacant(entry) => {
                let index = self.events.len();
                self.events.push(event);
                entry.insert(index);
                index
            }
        };
        Ok(EventRef {
            event: &self.events[index],
            index,
        })
    }
/// Inserts a new event into the graph.
///
/// FIXME: handle hash collisions.
Inserts a new event into the graph.
FIXME: handle hash collisions.
Inserts a new event into the graph . FIXME : handle hash collisions .
pub fn insert(&mut self, event: Event<N>) -> Result<EventRef<N>, Error> {
        let hash = compute_hash(&event).map_err(Error::Hash)?;
        let index = match self.indices.entry(hash) {
            Entry::Occupied(entry) => *entry.get(),
            Entry::Vacant(entry) => {
                let index = self.events.len();
                self.events.push(event);
                entry.insert(index);
                index
            }
        };
        Ok(EventRef {
            event: &self.events[index],
            index,
        })
    }
pub fn insert ( & mut self , event : Event < N > ) -> Result < EventRef < N > , Error > { let hash = compute_hash ( & event ) . map_err ( Error :: Hash ) ? ; let index = match self . indices . entry ( hash ) { Entry :: Occupied ( entry ) => * entry . get ( ) , Entry :: Vacant ( entry ) => { let index = self . events . len ( ) ; self . events . push ( event ) ; entry . insert ( index ) ; index } } ; Ok ( EventRef { event : & self . events [ index ] , index , } ) }
Inserts a new event into the graph.
Inserts a new event into the graph .
&mut self
event
Event<N>