ReportContext

Struct ReportContext 

Source
pub struct ReportContext<'a> {
    pub school: &'a School,
    pub plan: &'a Plan,
    pub degree: Option<&'a Degree>,
    pub metrics: &'a CurriculumMetrics,
    pub summary: &'a CurriculumSummary,
    pub dag: &'a DAG,
    pub term_plan: &'a TermPlan,
}
Expand description

Data context for report generation

This struct aggregates all data needed to render a curriculum report, providing a single source of truth for templates.

Fields§

§school: &'a School

School containing course catalog

§plan: &'a Plan

Curriculum plan being reported

§degree: Option<&'a Degree>

Associated degree (if found)

§metrics: &'a CurriculumMetrics

Computed metrics for courses

§summary: &'a CurriculumSummary

Summary statistics

§dag: &'a DAG

Prerequisite DAG

§term_plan: &'a TermPlan

Term-by-term course schedule

Implementations§

Source§

impl<'a> ReportContext<'a>

Source

pub const fn new( school: &'a School, plan: &'a Plan, degree: Option<&'a Degree>, metrics: &'a CurriculumMetrics, summary: &'a CurriculumSummary, dag: &'a DAG, term_plan: &'a TermPlan, ) -> Self

Create a new report context

Source

pub fn institution_name(&self) -> &str

Get the institution name

Source

pub fn degree_name(&self) -> String

Get the degree name or a default

Source

pub fn system_type(&self) -> &str

Get the system type (semester/quarter)

Source

pub fn cip_code(&self) -> &str

Get the CIP code

Source

pub fn total_credits(&self) -> f32

Calculate total credit hours

Source

pub const fn course_count(&self) -> usize

Get course count

Source

pub fn years(&self) -> f32

Calculate the number of years from the term plan

Trait Implementations§

Source§

impl<'a> Clone for ReportContext<'a>

Source§

fn clone(&self) -> ReportContext<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ReportContext<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ReportContext<'a>

§

impl<'a> RefUnwindSafe for ReportContext<'a>

§

impl<'a> Send for ReportContext<'a>

§

impl<'a> Sync for ReportContext<'a>

§

impl<'a> Unpin for ReportContext<'a>

§

impl<'a> UnwindSafe for ReportContext<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.