Struct racer::Session
[−]
[src]
pub struct Session<'c> { /* fields omitted */ }
Context for a Racer operation
Methods
impl<'c> Session<'c>
[src]
fn new(cache: &'c FileCache) -> Session<'c>
Create a Session for use in Racer operations
cache
is a reference to aFileCache
. It's take by reference for use across racer operations.
Examples
extern crate racer; let cache = racer::FileCache::default(); let session = racer::Session::new(&cache);
fn cache_file_contents<T, P>(&self, filepath: P, buf: T) where T: Into<String>, P: Into<PathBuf>
Specify the contents of a file to be used in completion operations
The path to the file and the file's contents must both be specified.
Examples
extern crate racer; let cache = racer::FileCache::default(); let session = racer::Session::new(&cache); session.cache_file_contents("foo.rs", "pub struct Foo;\\n");