skia_safe::document

Struct Document

Source
pub struct Document<'a, State = Open> { /* private fields */ }

Implementations§

Source§

impl<State> Document<'_, State>

Source

pub fn abort(self)

Source§

impl<'a> Document<'a, Open>

Source

pub fn pages(&self) -> usize

The number of pages in this document.

Source

pub fn begin_page( self, size: impl Into<Size>, content: Option<&Rect>, ) -> Document<'a, OnPage>

Source

pub fn close(self)

Close the document and return the encoded representation.

This function consumes and drops the document.

Source§

impl<'a> Document<'a, OnPage>

Source

pub fn page(&self) -> usize

The current page we are currently drawing on.

Source

pub fn canvas(&mut self) -> &Canvas

Borrows the canvas for the current page on the document.

Source

pub fn end_page(self) -> Document<'a>

Ends the page.

This function consumes the document and returns a new open document that contains the pages drawn so far.

Trait Implementations§

Source§

impl<State: Debug> Debug for Document<'_, State>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, State> Freeze for Document<'a, State>
where State: Freeze,

§

impl<'a, State> RefUnwindSafe for Document<'a, State>
where State: RefUnwindSafe,

§

impl<'a, State = Open> !Send for Document<'a, State>

§

impl<'a, State = Open> !Sync for Document<'a, State>

§

impl<'a, State> Unpin for Document<'a, State>
where State: Unpin,

§

impl<'a, State = Open> !UnwindSafe for Document<'a, State>

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.

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, 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.