[−][src]Struct rustc_data_structures::jobserver::GLOBAL_CLIENT

struct GLOBAL_CLIENT {
    __private_field: (),
}

Fields

__private_field: ()

Methods from Deref<Target = Client>

pub fn acquire(&self) -> Result<Acquired, Error>[src]

Acquires a token from this jobserver client.

This function will block the calling thread until a new token can be acquired from the jobserver.

Return value

On successful acquisition of a token an instance of Acquired is returned. This structure, when dropped, will release the token back to the jobserver. It's recommended to avoid leaking this value.

Errors

If an I/O error happens while acquiring a token then this function will return immediately with the error. If an error is returned then a token was not acquired.

pub fn configure(&self, cmd: &mut Command)[src]

Configures a child process to have access to this client's jobserver as well.

This function is required to be called to ensure that a jobserver is properly inherited to a child process. If this function is not called then this Client will not be accessible in the child process. In other words, if not called, then Client::from_env will return None in the child process (or the equivalent of Child::from_env that make uses).

Platform-specific behavior

On Unix and Windows this will clobber the CARGO_MAKEFLAGS environment variables for the child process, and on Unix this will also allow the two file descriptors for this client to be inherited to the child.

On platforms other than Unix and Windows this panics.

pub fn acquire_raw(&self) -> Result<(), Error>[src]

Blocks the current thread until a token is acquired.

This is the same as acquire, except that it doesn't return an RAII helper. If successful the process will need to guarantee that release_raw is called in the future.

pub fn release_raw(&self) -> Result<(), Error>[src]

Releases a jobserver token back to the original jobserver.

This is intended to be paired with acquire_raw if it was called, but in some situations it could also be called to relinquish a process's implicit token temporarily which is then re-acquired later.

Trait Implementations

impl Deref for GLOBAL_CLIENT[src]

type Target = Client

The resulting type after dereferencing.

impl LazyStatic for GLOBAL_CLIENT[src]

Auto Trait Implementations

impl RefUnwindSafe for GLOBAL_CLIENT

impl Send for GLOBAL_CLIENT

impl Sync for GLOBAL_CLIENT

impl Unpin for GLOBAL_CLIENT

impl UnwindSafe for GLOBAL_CLIENT

Blanket Implementations

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

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

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

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.