Reader

Struct Reader 

Source
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§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

Implementations§

Source§

impl Reader

Source

pub fn new( rect: Rectangle, info: Info, hub: &Hub, context: &mut Context, ) -> Option<Reader>

Source

pub fn from_html( rect: Rectangle, html: &str, link_uri: Option<&str>, hub: &Hub, context: &mut Context, ) -> Reader

Source

pub fn from_embedded_epub( rect: Rectangle, epub_bytes: &'static [u8], hub: &Hub, context: &mut Context, ) -> Option<Reader>

Source

fn load_pixmap(&mut self, location: usize)

Source

fn load_text(&mut self, location: usize)

Source

fn go_to_page( &mut self, location: usize, record: bool, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn go_to_chapter( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn text_location_range(&self) -> Option<[TextLocation; 2]>

Source

fn go_to_bookmark( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn go_to_annotation( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn go_to_last_page( &mut self, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn vertical_scroll( &mut self, delta_y: i32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn directional_scroll( &mut self, delta: Point, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn go_to_neighbor( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn go_to_results_page( &mut self, index: usize, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn go_to_results_neighbor( &mut self, dir: CycleDir, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn update_bottom_bar(&mut self, rq: &mut RenderQueue)

Source

fn update_tool_bar(&mut self, rq: &mut RenderQueue, context: &mut Context)

Source

fn update_results_bar(&mut self, rq: &mut RenderQueue)

Source

fn update_noninverted_regions(&mut self, inverted: bool)

Source

fn update_annotations(&mut self)

Source

fn update( &mut self, update_mode: Option<UpdateMode>, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn search(&mut self, text: &str, query: Regex, hub: &Hub, rq: &mut RenderQueue)

Source

fn toggle_keyboard( &mut self, enable: bool, id: Option<ViewId>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_tool_bar( &mut self, enable: bool, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_results_bar( &mut self, enable: bool, rq: &mut RenderQueue, _context: &mut Context, )

Source

fn toggle_bars( &mut self, enable: Option<bool>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_margin_cropper( &mut self, enable: bool, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_edit_note( &mut self, text: Option<String>, enable: Option<bool>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_name_page( &mut self, enable: Option<bool>, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_go_to_page( &mut self, enable: Option<bool>, id: ViewId, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

pub fn toggle_annotation_menu( &mut self, annot: &Annotation, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

pub fn toggle_selection_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

pub fn toggle_title_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_font_family_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_font_size_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_text_align_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_line_height_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_contrast_exponent_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_contrast_gray_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_margin_width_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_page_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_margin_cropper_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_search_menu( &mut self, rect: Rectangle, enable: Option<bool>, rq: &mut RenderQueue, context: &mut Context, )

Source

fn set_font_size( &mut self, font_size: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn set_text_align( &mut self, text_align: TextAlign, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn set_font_family( &mut self, font_family: &str, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn set_line_height( &mut self, line_height: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn set_margin_width( &mut self, width: i32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn toggle_bookmark(&mut self, rq: &mut RenderQueue)

Source

fn set_contrast_exponent( &mut self, exponent: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn set_contrast_gray( &mut self, gray: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source

fn set_zoom_mode( &mut self, zoom_mode: ZoomMode, reset_page_offset: bool, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn set_scroll_mode( &mut self, scroll_mode: ScrollMode, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn crop_margins( &mut self, index: usize, margin: &Margin, hub: &Hub, rq: &mut RenderQueue, context: &Context, )

Source

fn toc(&self) -> Option<Vec<TocEntry>>

Source

fn toc_aux( &self, simple_toc: &[SimpleTocEntry], index: &mut usize, ) -> Vec<TocEntry>

Source

fn find_page_by_name(&self, name: &str) -> Option<usize>

Source

fn text_excerpt(&self, sel: [TextLocation; 2]) -> Option<String>

Source

fn selected_text(&self) -> Option<String>

Source

fn text_rect(&self, sel: [TextLocation; 2]) -> Option<Rectangle>

Source

fn render_results(&self, rq: &mut RenderQueue)

Source

fn selection_rect(&self) -> Option<Rectangle>

Source

fn find_annotation_ref(&mut self, sel: [TextLocation; 2]) -> Option<&Annotation>

Source

fn find_annotation_mut( &mut self, sel: [TextLocation; 2], ) -> Option<&mut Annotation>

Source

fn reseed(&mut self, rq: &mut RenderQueue, context: &mut Context)

Source

fn quit(&mut self, context: &mut Context)

Source

fn scale_page( &mut self, center: Point, factor: f32, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Trait Implementations§

Source§

impl View for Reader

Source§

fn handle_event( &mut self, evt: &Event, hub: &Hub, _bus: &mut Bus, rq: &mut RenderQueue, context: &mut Context, ) -> bool

Source§

fn render(&self, fb: &mut dyn Framebuffer, rect: Rectangle, _fonts: &mut Fonts)

Source§

fn render_rect(&self, rect: &Rectangle) -> Rectangle

Source§

fn resize( &mut self, rect: Rectangle, hub: &Hub, rq: &mut RenderQueue, context: &mut Context, )

Source§

fn might_rotate(&self) -> bool

Source§

fn is_background(&self) -> bool

Source§

fn rect(&self) -> &Rectangle

Source§

fn rect_mut(&mut self) -> &mut Rectangle

Source§

fn children(&self) -> &Vec<Box<dyn View>>

Source§

fn children_mut(&mut self) -> &mut Vec<Box<dyn View>>

Source§

fn id(&self) -> Id

Source§

fn child(&self, index: usize) -> &dyn View

Source§

fn child_mut(&mut self, index: usize) -> &mut dyn View

Source§

fn len(&self) -> usize

Source§

fn might_skip(&self, _evt: &Event) -> bool

Source§

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 !UnwindSafe for Reader

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
§

impl<T> Downcast for T
where T: 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>

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)

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)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more