pub struct PrintData { /* private fields */ }Expand description
Framework-independent builder for the shared PREPEJ print-document format. One instance belongs to one report/request; input definitions and output are cloned.
Implementations§
Source§impl PrintData
impl PrintData
pub fn new() -> Self
pub fn set_definition(&mut self, definition: &Value) -> Result<&mut Self>
pub fn page_start(&mut self) -> Result<&mut Self>
pub fn page_start_with( &mut self, definition: Option<&Value>, ) -> Result<&mut Self>
pub fn set_value<T: Into<Value> + 'static>( &mut self, name: &str, value: T, ) -> Result<&mut Self>
pub fn set_value_at( &mut self, name: &str, value: impl Into<Value> + 'static, index: usize, drawing: bool, ) -> Result<&mut Self>
pub fn set_repeated_value( &mut self, name: &str, value: impl Into<Value> + 'static, x: usize, y: usize, drawing: bool, ) -> Result<&mut Self>
pub fn set_typed_value( &mut self, name: &str, kind: &str, value: impl Into<Value> + 'static, index: usize, drawing: bool, ) -> Result<&mut Self>
pub fn set_image( &mut self, name: &str, source: impl Into<Value> + 'static, ) -> Result<&mut Self>
pub fn set_barcode( &mut self, name: &str, code: impl Into<Value> + 'static, ) -> Result<&mut Self>
pub fn draw_object( &mut self, name: &str, index: usize, kind: &str, ) -> Result<&mut Self>
pub fn change_attributes( &mut self, name: &str, values: Value, index: usize, ) -> Result<&mut Self>
pub fn change_repeated_attributes( &mut self, name: &str, values: Value, index: usize, repeat: Option<(usize, usize)>, kind: &str, ) -> Result<&mut Self>
pub fn page_end(&mut self) -> Result<&mut Self>
pub fn to_value(&self) -> Result<Value>
pub fn to_json(&self, pretty: bool) -> Result<String>
pub fn save(&self, path: &Path) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrintData
impl RefUnwindSafe for PrintData
impl Send for PrintData
impl Sync for PrintData
impl Unpin for PrintData
impl UnsafeUnpin for PrintData
impl UnwindSafe for PrintData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more