Skip to main content

weir/
fixed_point_resident_plan.rs

1//! Resident fixed-point graph plans paired with compiled Vyre pipelines.
2
3mod borrowed;
4mod generic;
5mod owned;
6
7#[cfg(test)]
8mod tests;
9
10use crate::fixed_point_resident::FixedPointResidentGraph;
11
12pub use generic::{GraphRef, PlanBuilder};
13
14/// Resident graph resources paired with a backend-compiled pipeline.
15#[derive(Clone, Debug, PartialEq)]
16pub struct FixedPointResidentPlan {
17    pub(crate) inner: generic::PlanBuilder<FixedPointResidentGraph>,
18}
19
20/// Borrowed resident graph resources paired with a backend-compiled pipeline.
21///
22/// Use this with [`crate::fixed_point_resident_cache::FixedPointResidentGraphCache`]
23/// so repeated equivalent graph layouts can share one resident upload while
24/// still exposing the same execution shape as [`FixedPointResidentPlan`].
25#[derive(Clone, Debug, PartialEq)]
26pub struct FixedPointBorrowedResidentPlan<'a> {
27    pub(crate) inner: generic::PlanBuilder<&'a FixedPointResidentGraph>,
28}
29
30impl std::ops::Deref for FixedPointResidentPlan {
31    type Target = generic::PlanBuilder<FixedPointResidentGraph>;
32
33    fn deref(&self) -> &Self::Target {
34        &self.inner
35    }
36}
37
38impl<'a> std::ops::Deref for FixedPointBorrowedResidentPlan<'a> {
39    type Target = generic::PlanBuilder<&'a FixedPointResidentGraph>;
40
41    fn deref(&self) -> &Self::Target {
42        &self.inner
43    }
44}