pub fn dereference<'a>(&'a self, mut object: &'a Object) -> Result<(Option<ObjectId>, &'a Object)> {
        let mut nb_deref = 0;
        let mut id = None;

        while let Ok(ref_id) = object.as_reference() {
            id = Some(ref_id);
            object = self.objects.get(&ref_id).ok_or(Error::ObjectNotFound)?;

            nb_deref += 1;
            if nb_deref > Self::DEREF_LIMIT {
                return Err(Error::ReferenceLimit);
            }
        }

        Ok((id, object))
    }
/// Follow references if the supplied object is a reference.
///
/// Returns a tuple of an optional object id and final object.
/// The object id will be None if the object was not a
/// reference. Otherwise, it will be the last object id in the
/// reference chain.
Follow references if the supplied object is a reference.
Returns a tuple of an optional object id and final object.
The object id will be None if the object was not a
reference. Otherwise, it will be the last object id in the
reference chain.
Follow references if the supplied object is a reference . Returns a tuple of an optional object id and final object . The object id will be None if the object was not a reference . Otherwise it will be the last object id in the reference chain .
pub fn dereference<'a>(&'a self, mut object: &'a Object) -> Result<(Option<ObjectId>, &'a Object)> {
        let mut nb_deref = 0;
        let mut id = None;
        while let Ok(ref_id) = object.as_reference() {
            id = Some(ref_id);
            object = self.objects.get(&ref_id).ok_or(Error::ObjectNotFound)?;
            nb_deref += 1;
            if nb_deref > Self::DEREF_LIMIT {
                return Err(Error::ReferenceLimit);
            }
        }
        Ok((id, object))
    }
pub fn dereference < ' a > ( & ' a self , mut object : & ' a Object ) -> Result < ( Option < ObjectId > , & ' a Object ) > { let mut nb_deref = 0 ; let mut id = None ; while let Ok ( ref_id ) = object . as_reference ( ) { id = Some ( ref_id ) ; object = self . objects . get ( & ref_id ) . ok_or ( Error :: ObjectNotFound ) ? ; nb_deref += 1 ; if nb_deref > Self :: DEREF_LIMIT { return Err ( Error :: ReferenceLimit ) ; } } Ok ( ( id , object ) ) }
Follow references if the supplied object is a reference.
Follow references if the supplied object is a reference .
&'a self
object
&'a Object
&'a self
object
&'a Object