LogMessage

Enum LogMessage 

Source
pub enum LogMessage {
    BuildStarted {
        cwd: PathBuf,
        host: String,
        jobs: u32,
        profile: String,
        rustc_version: String,
        rustc_version_verbose: String,
        target_dir: PathBuf,
        workspace_root: PathBuf,
    },
    UnitStarted {
        package_id: PackageIdSpec,
        target: Target,
        mode: CompileMode,
        index: u64,
        elapsed: f64,
    },
    UnitRmetaFinished {
        index: u64,
        elapsed: f64,
        unblocked: Vec<u64>,
    },
    UnitSectionStarted {
        index: u64,
        elapsed: f64,
        section: String,
    },
    UnitSectionFinished {
        index: u64,
        elapsed: f64,
        section: String,
    },
    UnitFinished {
        index: u64,
        elapsed: f64,
        unblocked: Vec<u64>,
    },
    Rebuild {
        package_id: PackageIdSpec,
        target: Target,
        mode: CompileMode,
        cause: DirtyReason,
    },
}
Expand description

A log message.

Each variant represents a different type of event.

Variants§

§

BuildStarted

Emitted when a build starts.

Fields

§cwd: PathBuf

Current working directory.

§host: String

Host triple.

§jobs: u32

Number of parallel jobs.

§profile: String

Build profile name (e.g., “dev”, “release”).

§rustc_version: String

The rustc version (1.23.4-beta.2).

§rustc_version_verbose: String

The rustc verbose version information (the output of rustc -vV).

§target_dir: PathBuf

Target directory for build artifacts.

§workspace_root: PathBuf

Workspace root directory.

§

UnitStarted

Emitted when a compilation unit starts.

Fields

§package_id: PackageIdSpec

Package ID specification.

§target: Target

Cargo target (lib, bin, example, etc.).

§mode: CompileMode

The compilation action this unit is for (check, build, test, etc.).

§index: u64

Unit index for compact reference in subsequent events.

§elapsed: f64

Seconds elapsed from build start.

§

UnitRmetaFinished

Emitted when a section (e.g., rmeta, link) of the compilation unit finishes.

Fields

§index: u64

Unit index from the associated unit-started event.

§elapsed: f64

Seconds elapsed from build start.

§unblocked: Vec<u64>

Unit indices that were unblocked by this rmeta completion.

§

UnitSectionStarted

Emitted when a section (e.g., rmeta, link) of the compilation unit starts.

Requires -Zsection-timings to be enabled.

Fields

§index: u64

Unit index from the associated unit-started event.

§elapsed: f64

Seconds elapsed from build start.

§section: String

Section name from rustc’s -Zjson=timings (e.g., “codegen”, “link”).

§

UnitSectionFinished

Emitted when a section (e.g., rmeta, link) of the compilation unit finishes.

Requires -Zsection-timings to be enabled.

Fields

§index: u64

Unit index from the associated unit-started event.

§elapsed: f64

Seconds elapsed from build start.

§section: String

Section name from rustc’s -Zjson=timings (e.g., “codegen”, “link”).

§

UnitFinished

Emitted when a compilation unit finishes.

Fields

§index: u64

Unit index from the associated unit-started event.

§elapsed: f64

Seconds elapsed from build start.

§unblocked: Vec<u64>

Unit indices that were unblocked by this completion.

§

Rebuild

Emitted when a unit needs to be rebuilt.

Fields

§package_id: PackageIdSpec

Package ID specification.

§target: Target

Cargo target (lib, bin, example, etc.).

§mode: CompileMode

The compilation action this unit is for (check, build, test, etc.).

§cause: DirtyReason

Reason why the unit is dirty and needs rebuilding.

Implementations§

Source§

impl LogMessage

Source

pub fn write_json_log<W: Write>( &self, writer: &mut W, run_id: &str, ) -> Result<()>

Serializes this message as a JSON log line directly to the writer.

Trait Implementations§

Source§

impl Serialize for LogMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 344 bytes

Size for each variant:

  • BuildStarted: 184 bytes
  • UnitStarted: 272 bytes
  • UnitRmetaFinished: 48 bytes
  • UnitSectionStarted: 48 bytes
  • UnitSectionFinished: 48 bytes
  • UnitFinished: 48 bytes
  • Rebuild: 344 bytes