pub struct ProcMacroClient { /* private fields */ }Expand description
A handle to an external process which load dylibs with macros (.so or .dll) and runs actual macro expansion functions.
Implementations§
Source§impl ProcMacroClient
impl ProcMacroClient
Sourcepub fn spawn<'a>(
process_path: &AbsPath,
env: impl IntoIterator<Item = (impl AsRef<OsStr>, &'a Option<impl 'a + AsRef<OsStr>>)> + Clone,
) -> Result<ProcMacroClient>
pub fn spawn<'a>( process_path: &AbsPath, env: impl IntoIterator<Item = (impl AsRef<OsStr>, &'a Option<impl 'a + AsRef<OsStr>>)> + Clone, ) -> Result<ProcMacroClient>
Spawns an external process as the proc macro server and returns a client connected to it.
Sourcepub fn server_path(&self) -> &AbsPath
pub fn server_path(&self) -> &AbsPath
Returns the absolute path to the proc-macro server.
Sourcepub fn load_dylib(
&self,
dylib: MacroDylib,
) -> Result<Vec<ProcMacro>, ServerError>
pub fn load_dylib( &self, dylib: MacroDylib, ) -> Result<Vec<ProcMacro>, ServerError>
Loads a proc-macro dylib into the server process returning a list of ProcMacros loaded.
Sourcepub fn exited(&self) -> Option<&ServerError>
pub fn exited(&self) -> Option<&ServerError>
Checks if the proc-macro server has exited.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcMacroClient
impl RefUnwindSafe for ProcMacroClient
impl Send for ProcMacroClient
impl Sync for ProcMacroClient
impl Unpin for ProcMacroClient
impl UnwindSafe for ProcMacroClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more