Skip to main content

DeckSession

Struct DeckSession 

Source
pub struct DeckSession { /* private fields */ }

Implementations§

Source§

impl DeckSession

Source

pub fn snapshot(&self) -> EditResult<DeckSnapshot>

Source

pub fn insert_slide( &self, context: &EditCtx, index: u32, layout_part_path: Option<&str>, ) -> EditResult<SlideReceipt>

Source

pub fn delete_slide( &self, context: &EditCtx, slide_id: &str, ) -> EditResult<SlideReceipt>

Source

pub fn move_slide( &self, context: &EditCtx, slide_id: &str, to_index: u32, ) -> EditResult<SlideReceipt>

Source

pub fn add_text_box( &self, context: &EditCtx, slide_id: &str, draft: &ShapeDraft, ) -> EditResult<ShapeReceipt>

Source

pub fn remove_shape( &self, context: &EditCtx, slide_id: &str, shape_id: &str, ) -> EditResult<ShapeReceipt>

Source

pub fn move_shape( &self, context: &EditCtx, slide_id: &str, shape_id: &str, x: i64, y: i64, ) -> EditResult<TransformReceipt>

Source

pub fn resize_shape( &self, context: &EditCtx, slide_id: &str, shape_id: &str, width: i64, height: i64, ) -> EditResult<TransformReceipt>

Source§

impl DeckSession

Source

pub fn story(&self, story_id: &str) -> EditResult<StorySnapshot>

Source

pub fn insert_text( &self, context: &EditCtx, story_id: &str, index: u32, text: &str, style: &TextStyle, ) -> EditResult<TextReceipt>

Source

pub fn delete_text( &self, context: &EditCtx, story_id: &str, start: u32, end: u32, ) -> EditResult<TextReceipt>

Source

pub fn format_text( &self, context: &EditCtx, story_id: &str, start: u32, end: u32, patch: &TextStylePatch, ) -> EditResult<TextReceipt>

Source

pub fn insert_paragraph_break( &self, context: &EditCtx, story_id: &str, index: u32, ) -> EditResult<TextReceipt>

Source§

impl DeckSession

Source

pub fn open(bytes: &[u8], client_id: u64) -> EditResult<Self>

Source

pub fn from_package(package: PptxPackage, client_id: u64) -> EditResult<Self>

Opens an edit session from an already parsed package.

Source

pub fn open_from_update(update: &[u8], client_id: u64) -> EditResult<Self>

Source

pub fn client_id(&self) -> u64

Source

pub fn package(&self) -> &PptxPackage

Source

pub fn yrs_doc(&self) -> &Doc

Source

pub fn encode_state_vector_v1(&self) -> Vec<u8> ⓘ

Source

pub fn encode_state_as_update_v1(&self) -> Vec<u8> ⓘ

Source

pub fn encode_diff_v1(&self, remote_state_vector: &[u8]) -> EditResult<Vec<u8>>

Source

pub fn apply_update_v1(&self, bytes: &[u8]) -> EditResult<DeckSnapshot>

Source

pub fn observe_update_v1<F>(&self, callback: F) -> EditResult<Subscription>
where F: Fn(UpdateEvent) + 'static,

Source

pub fn undo(&self) -> bool

Source

pub fn redo(&self) -> bool

Source

pub fn can_undo(&self) -> bool

Source

pub fn can_redo(&self) -> bool

Source

pub fn add_undo_barrier(&self)

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more