Skip to main content

pushrod/
lib.rs

1// Pushrod
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! # rust-pushrod
16//!
17//! Pushrod is a library written entirely in Rust for drawing interactive elements to a window.
18//!
19//! It is an event-based GUI library that utilizes an event loop to handle the event, dispatch, and
20//! draw loop.
21//!
22//! # Core, widgets, and backends
23//!
24//! This crate is the core: the engine, the `Widget` trait and widget tree, events, input types,
25//! the [`Backend`](backend::Backend) trait, the backend-neutral `Painter` API and `paint`
26//! helpers.  It has no windowing-library dependency.  It contains no widgets except the
27//! window's [`RootWidget`](root_widget::RootWidget).  The standard widgets (buttons, text, boxes,
28//! and the rest) live in the `pushrod-widgets` crate, which depends on this crate only.
29//!
30//! An application picks a backend crate.  `pushrod-sdl2` draws with `SDL2`:
31//!
32//! ```ignore
33//! pushrod_sdl2::run(engine, pushrod_sdl2::WindowSettings::new("App", size(400, 300)), state);
34//! ```
35//!
36//! For tests, [`HeadlessBackend`](backend::headless::HeadlessBackend) needs no display.
37
38// Every public item is documented, including `# Panics` and `# Errors` sections where they
39// apply.  scripts/check_docs.py checks the rest (see CONTRIBUTING.md, "Code documentation").
40#![warn(missing_docs, clippy::missing_panics_doc, clippy::missing_errors_doc)]
41// Library code returns `Error` instead of panicking; tests may unwrap.
42#![cfg_attr(not(test), deny(clippy::unwrap_used, clippy::expect_used))]
43
44pub mod appearance;
45pub mod backend;
46pub mod cache;
47pub mod color;
48pub mod controllers;
49pub mod engine;
50pub mod error;
51pub mod event;
52pub mod geometry;
53pub mod input;
54pub mod paint;
55pub mod root_widget;
56pub mod text;
57pub mod timer;
58pub mod widget;