pub struct Reader {Show 27 fields
id: Id,
rect: Rectangle,
children: Vec<Box<dyn View>>,
doc: Arc<Mutex<Box<dyn Document>>>,
cache: BTreeMap<usize, Resource>,
chunks: Vec<RenderChunk>,
text: FxHashMap<usize, Vec<BoundedText>>,
annotations: FxHashMap<usize, Vec<Annotation>>,
noninverted_regions: FxHashMap<usize, Vec<Boundary>>,
focus: Option<ViewId>,
search: Option<Search>,
search_direction: LinearDir,
held_buttons: FxHashSet<ButtonCode>,
selection: Option<Selection>,
target_annotation: Option<[TextLocation; 2]>,
history: VecDeque<usize>,
state: State,
info: Info,
current_page: usize,
pages_count: usize,
view_port: ViewPort,
contrast: Contrast,
synthetic: bool,
page_turns: usize,
reflowable: bool,
ephemeral: bool,
finished: bool,
}Fields§
§id: Id§rect: Rectangle§children: Vec<Box<dyn View>>§doc: Arc<Mutex<Box<dyn Document>>>§cache: BTreeMap<usize, Resource>§chunks: Vec<RenderChunk>§text: FxHashMap<usize, Vec<BoundedText>>§annotations: FxHashMap<usize, Vec<Annotation>>§noninverted_regions: FxHashMap<usize, Vec<Boundary>>§focus: Option<ViewId>§search: Option<Search>§search_direction: LinearDir§selection: Option<Selection>§target_annotation: Option<[TextLocation; 2]>§history: VecDeque<usize>§state: State§info: Info§current_page: usize§pages_count: usize§view_port: ViewPort§contrast: Contrast§synthetic: bool§page_turns: usize§reflowable: bool§ephemeral: bool§finished: boolImplementations§
Source§impl Reader
impl Reader
pub fn new( rect: Rectangle, info: Info, hub: &Hub, context: &mut Context, ) -> Option<Reader>
pub fn from_html( rect: Rectangle, html: &str, link_uri: Option<&str>, hub: &Hub, context: &mut Context, ) -> Reader
pub fn from_embedded_epub( rect: Rectangle, epub_bytes: &'static [u8], hub: &Hub, context: &mut Context, ) -> Option<Reader>
fn load_pixmap(&mut self, location: usize)
fn load_text(&mut self, location: usize)
fn go_to_page( &mut self, location: usize, record: bool, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn go_to_chapter( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn text_location_range(&self) -> Option<[TextLocation; 2]>
fn go_to_bookmark( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn go_to_annotation( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn go_to_last_page( &mut self, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn vertical_scroll( &mut self, delta_y: i32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn directional_scroll( &mut self, delta: Point, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn go_to_neighbor( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn go_to_results_page( &mut self, index: usize, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn go_to_results_neighbor( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn update_bottom_bar(&mut self, rq: &mut RenderQueue)
fn update_tool_bar(&mut self, rq: &mut RenderQueue, context: &mut Context)
fn update_results_bar(&mut self, rq: &mut RenderQueue)
fn update_noninverted_regions(&mut self, inverted: bool)
fn update_annotations(&mut self)
fn update( &mut self, update_mode: Option<UpdateMode>, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn search(&mut self, text: &str, query: Regex, hub: &Hub, rq: &mut RenderQueue)
fn toggle_keyboard( &mut self, enable: bool, id: Option<ViewId>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_tool_bar( &mut self, enable: bool, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_results_bar( &mut self, enable: bool, rq: &mut RenderQueue, _context: &mut Context, )
fn toggle_search_bar( &mut self, enable: bool, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_bars( &mut self, enable: Option<bool>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_margin_cropper( &mut self, enable: bool, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_edit_note( &mut self, text: Option<String>, enable: Option<bool>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_name_page( &mut self, enable: Option<bool>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_go_to_page( &mut self, enable: Option<bool>, id: ViewId, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn set_font_size( &mut self, font_size: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn set_text_align( &mut self, text_align: TextAlign, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn set_font_family( &mut self, font_family: &str, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn set_line_height( &mut self, line_height: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn set_margin_width( &mut self, width: i32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn toggle_bookmark(&mut self, rq: &mut RenderQueue)
fn set_contrast_exponent( &mut self, exponent: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn set_contrast_gray( &mut self, gray: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn set_zoom_mode( &mut self, zoom_mode: ZoomMode, reset_page_offset: bool, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn set_scroll_mode( &mut self, scroll_mode: ScrollMode, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn crop_margins( &mut self, index: usize, margin: &Margin, hub: &Hub, rq: &mut RenderQueue, context: &Context, )
fn toc(&self) -> Option<Vec<TocEntry>>
fn toc_aux( &self, simple_toc: &[SimpleTocEntry], index: &mut usize, ) -> Vec<TocEntry>
fn find_page_by_name(&self, name: &str) -> Option<usize>
fn text_excerpt(&self, sel: [TextLocation; 2]) -> Option<String>
fn selected_text(&self) -> Option<String>
fn text_rect(&self, sel: [TextLocation; 2]) -> Option<Rectangle>
fn render_results(&self, rq: &mut RenderQueue)
fn selection_rect(&self) -> Option<Rectangle>
fn find_annotation_ref(&mut self, sel: [TextLocation; 2]) -> Option<&Annotation>
fn find_annotation_mut( &mut self, sel: [TextLocation; 2], ) -> Option<&mut Annotation>
fn reseed(&mut self, rq: &mut RenderQueue, context: &mut Context)
fn quit(&mut self, context: &mut Context)
fn scale_page( &mut self, center: Point, factor: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
Trait Implementations§
Source§impl View for Reader
impl View for Reader
fn handle_event( &mut self, evt: &Event, hub: &Hub, _bus: &mut Bus, rq: &mut RenderQueue, context: &mut Context, ) -> bool
fn render(&self, fb: &mut dyn Framebuffer, rect: Rectangle, _fonts: &mut Fonts)
fn render_rect(&self, rect: &Rectangle) -> Rectangle
fn resize( &mut self, rect: Rectangle, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )
fn might_rotate(&self) -> bool
fn is_background(&self) -> bool
fn rect(&self) -> &Rectangle
fn rect_mut(&mut self) -> &mut Rectangle
fn children(&self) -> &Vec<Box<dyn View>>
fn children_mut(&mut self) -> &mut Vec<Box<dyn View>>
fn id(&self) -> Id
fn child(&self, index: usize) -> &dyn View
fn child_mut(&mut self, index: usize) -> &mut dyn View
fn len(&self) -> usize
fn might_skip(&self, _evt: &Event) -> bool
fn view_id(&self) -> Option<ViewId>
Auto Trait Implementations§
impl Freeze for Reader
impl !RefUnwindSafe for Reader
impl !Send for Reader
impl !Sync for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
impl !UnwindSafe for Reader
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more