Skip to main content

laser_pdf/elements/
ref_element.rs

1use crate::*;
2
3pub struct RefElement<'a, E: Element>(pub &'a E);
4
5impl<'a, E: Element> Element for RefElement<'a, E> {
6    fn first_location_usage(&self, ctx: FirstLocationUsageCtx) -> FirstLocationUsage {
7        self.0.first_location_usage(ctx)
8    }
9
10    fn measure(&self, ctx: MeasureCtx) -> ElementSize {
11        self.0.measure(ctx)
12    }
13
14    fn draw(&self, ctx: DrawCtx) -> ElementSize {
15        self.0.draw(ctx)
16    }
17}