pub fn load(&mut self) -> Result<Option<Vec<T>>, DatabaseError> {
        let mut buf = Vec::new();
        self.file.seek(SeekFrom::Start(0))?;
        self.file.read_to_end(&mut buf)?;
        if buf.is_empty() {
            return Ok(None);
        }
        let result = binary_to_vec(&buf)?;
        Ok(Some(result))
    }
/// Returns a collection. If the file is empty, this method
/// returns `Ok(None)`.
///
/// The collection is returned in the order in which the documents
/// were inserted into the file previously.
///
/// # Errors
///
/// - If a checksum mismatch occurs, a `DatabaseError::MismatchedChecksum` error
/// is returned.
///
/// - `bincode::Error` occurs if the deserializer fails to deserialize bytes from
/// the file to your requested document type. In that case, the most probable reason
/// is that the data in that file stores data of some other data type and you are
/// attempting to deserialize it to the wrong data type.
///
/// - `std::io::Error`
Returns a collection. If the file is empty, this method
returns `Ok(None)`.

The collection is returned in the order in which the documents
were inserted into the file previously.
Returns a collection . If the file is empty this method returns ` Ok ( None ) ` . The collection is returned in the order in which the documents were inserted into the file previously .
pub fn load(&mut self) -> Result<Option<Vec<T>>, DatabaseError> {
        let mut buf = Vec::new();
        self.file.seek(SeekFrom::Start(0))?;
        self.file.read_to_end(&mut buf)?;
        if buf.is_empty() {
            return Ok(None);
        }
        let result = binary_to_vec(&buf)?;
        Ok(Some(result))
    }
pub fn load ( & mut self ) -> Result < Option < Vec < T > > , DatabaseError > { let mut buf = Vec :: new ( ) ; self . file . seek ( SeekFrom :: Start ( 0 ) ) ? ; self . file . read_to_end ( & mut buf ) ? ; if buf . is_empty ( ) { return Ok ( None ) ; } let result = binary_to_vec ( & buf ) ? ; Ok ( Some ( result ) ) }
Returns a collection.
Returns a collection .
&mut self
&mut self
errors
If a checksum mismatch occurs, a `DatabaseError::MismatchedChecksum` error
is returned.

`bincode::Error` occurs if the deserializer fails to deserialize bytes from
the file to your requested document type. In that case, the most probable reason
is that the data in that file stores data of some other data type and you are
attempting to deserialize it to the wrong data type.


If a checksum mismatch occurs a ` DatabaseError :: MismatchedChecksum ` error is returned . ` bincode :: Error ` occurs if the deserializer fails to deserialize bytes from the file to your requested document type . In that case the most probable reason is that the data in that file stores data of some other data type and you are attempting to deserialize it to the wrong data type .