[][src]Struct racer::Session

pub struct Session<'c> {
    pub generic_impls: RefCell<HashMap<(PathBuf, BytePos), Vec<Rc<ImplHeader>>>>,
    pub project_model: Box<dyn ProjectModelProvider + 'c>,
    // some fields omitted
}

Context for a Racer operation

Fields

generic_impls: RefCell<HashMap<(PathBuf, BytePos), Vec<Rc<ImplHeader>>>>

Cache for generic impls

project_model: Box<dyn ProjectModelProvider + 'c>

Methods

impl<'c> Session<'c>[src]

pub fn new(cache: &'c FileCache) -> Session<'c>[src]

Create a Session for use in Racer operations

  • cache is a reference to a FileCache. 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);

pub fn with_project_model(
    cache: &'c FileCache,
    project_model: Box<dyn ProjectModelProvider + 'c>
) -> Session<'c>
[src]

pub fn cache_file_contents<T, P>(&self, filepath: P, buf: T) where
    T: Into<String>,
    P: Into<PathBuf>, 
[src]

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");

pub fn contains_file<P: AsRef<Path>>(&self, path: P) -> bool[src]

Trait Implementations

impl<'c> Debug for Session<'c>[src]

Auto Trait Implementations

impl<'c> !Send for Session<'c>

impl<'c> !Sync for Session<'c>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Erased for T