You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: file.rs
    path of file: ./repos/OpenSK/libraries/persistent_store/src
    
    the code of the file until where you have to start completion: // Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! File-backed persistent flash storage for virtual authent
    
    pub fn new(path: &Path, options: FileOptions) -> StorageResult<FileStorage> {
        let mut file_ref = RefCell::new(
            OpenOptions::new()
                .read(true)
                .write(true)
                .create(true)
                .open(path)?,
        );
        let file = file_ref.get_mut();
        let file_len = file.metadata()?.len();
        let store_len: u64 = (options.page_size * options.num_pages) as u64;

        if file_len == 0 {
            file.seek(SeekFrom::Start(0))?;
            let buf = vec![0xff; options.page_size];
            for _ in 0..options.num_pages {
                file.write(&buf)?;
            }
        } else if file_len != store_len {
            // FileStorage buffer should be of fixed size, opening previously saved file
            // from storage of different size is not supported
            panic!("Invalid file size {}, should be {}", file_len, store_len);
        }
        Ok(FileStorage {
            options,
            file: file_ref,
        })
    }