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: files.rs
    path of file: ./repos/rdms/src/robt
    
    the code of the file until where you have to start completion: use std::{convert::TryFrom, ffi, fmt, path, result};

use crate::{Error, Result};

/// An Index file is uniquely locatable by providing the `dir` and name.
/// where `dir` is the directory in which the index file is located and `name`
/// is the unique name for the index. `format!("{}-robt.indx", name)`
#[derive(Clone)]
pub struct IndexFileName(pub ffi::OsString);

impl From<String> for IndexFileName {
    
    fn try_from(fname: IndexFileName) -> Result<String> {
        let ffpp = path::Path::new(&fname.0);
        let fname = || -> Option<&str> {
            let fname = ffpp.file_name()?;
            if fname.to_str()?.ends_with("-robt.indx") {
                Some(path::Path::new(fname).file_stem()?.to_str()?)
            } else {
                None
            }
        }();

        match fname {
            Some(fname) => Ok(fname.strip_suffix("-robt").unwrap().to_string()),
            None => err_at!(InvalidFile, msg: "{:?}", ffpp),
        }
    }