FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    RichTextTransfer

    struct · ferroui-controls · v0.5.0

    struct RichTextTransfer
    

    Framework-native clipboard exchange. In-process transfers retain the exact immutable document fragment, including inline controls; external applications receive text and RTF.

    View source

    Members

    document_format

    fn document_format() -> DataFormatOf<DocumentSnapshot>
    

    Source

    rtf_formats

    fn rtf_formats() -> Vec<DataFormatOf<Rc<[u8]>>>
    

    Source

    create

    fn create(fragment: &DocumentSnapshot, format: RichEditClipboardFormat) -> Rc<dyn IAsyncDataTransfer>
    

    Builds one clipboard item containing all applicable formats. If a rich feature has no RTF representation, the exact in-process fragment and plain text are still offered.

    Source

    create_with_default_tab_stop

    fn create_with_default_tab_stop(fragment: &DocumentSnapshot, format: RichEditClipboardFormat, default_tab_stop: f64) -> Rc<dyn IAsyncDataTransfer>
    

    Includes RTF using the owning editor's default interval while retaining the exact original snapshot in the in-process clipboard format.

    Source

    read

    async fn read(data: &dyn IAsyncDataTransfer, plain_text_only: bool) -> Result<Option<DocumentSnapshot>, ClipboardError>
    

    Reads the highest-fidelity offered format. A malformed advertised RTF payload is reported to the caller instead of silently replacing formatted content with text.

    Source

    read_for_insertion

    async fn read_for_insertion(data: &dyn IAsyncDataTransfer, plain_text_only: bool, default_tab_stop: f64) -> Result<Option<DocumentSnapshot>, ClipboardError>
    

    Imports external RTF for insertion into an existing editor. Its document default is replaced by the destination's interval; explicit stops remain. Exact in-process fragments retain their paragraph formatting unchanged.

    Source

    can_read

    fn can_read(data: &dyn IAsyncDataTransfer, format: RichTextPasteFormat) -> Result<bool, ClipboardError>
    

    Checks advertised formats without requesting or decoding their payloads. A true result does not promise that a later platform read will succeed or that an advertised RTF payload is well formed.

    Source

    read_with_format

    async fn read_with_format(data: &dyn IAsyncDataTransfer, format: RichTextPasteFormat) -> Result<Option<DocumentSnapshot>, ClipboardError>
    

    Reads exactly the requested representation policy. The caller retains ownership of data and is responsible for disposing a retrieved transfer.

    Source

    read_with_format_for_insertion

    async fn read_with_format_for_insertion(data: &dyn IAsyncDataTransfer, format: RichTextPasteFormat, default_tab_stop: f64) -> Result<Option<DocumentSnapshot>, ClipboardError>
    

    Reads a chosen format for an existing editor, applying its default tab interval to external RTF while retaining explicit paragraph tab stops.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.