pub struct ImageFileMediaSource;Expand description
The media producer that draws an image-mode buffer’s own file.
The mode owns its picture the way org owns its inline ones: through the
media-source registry, off the render path, sized and decoded by the host.
There is no image-specific code in the renderer or the host because of it —
an image-mode buffer is one block anchored at line 0, which is the same
thing an org buffer produces several of.
Trait Implementations§
Source§impl AsyncMediaSource for ImageFileMediaSource
impl AsyncMediaSource for ImageFileMediaSource
Source§fn source_id(&self) -> u64
fn source_id(&self) -> u64
Stable id of the producing plugin — the teardown key. Two producers
with the same id are the same plugin, so a reload replaces rather than
duplicates.
Source§fn produce(
&self,
_buffer_id: u64,
path: Option<PathBuf>,
_line_count: u32,
_text: String,
) -> MediaFuture<'_>
fn produce( &self, _buffer_id: u64, path: Option<PathBuf>, _line_count: u32, _text: String, ) -> MediaFuture<'_>
Produce this buffer’s media blocks off the render path.
text is the buffer’s contents. Passed by value rather than through a
document handle because a media scan reads EVERY line: a handle would
cost one boundary crossing per line, where one copy costs one. The copy
is affordable because this runs on open / edit, not per frame.Auto Trait Implementations§
impl Freeze for ImageFileMediaSource
impl RefUnwindSafe for ImageFileMediaSource
impl Send for ImageFileMediaSource
impl Sync for ImageFileMediaSource
impl Unpin for ImageFileMediaSource
impl UnsafeUnpin for ImageFileMediaSource
impl UnwindSafe for ImageFileMediaSource
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