1.6.0 - add optional serde implementations
This commit is contained in:
parent
dce5e7500f
commit
f094c38d18
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "termion"
|
||||
version = "1.5.6"
|
||||
version = "1.6.0"
|
||||
authors = ["ticki <Ticki@users.noreply.github.com>", "gycos <alexandre.bury@gmail.com>", "IGI-111 <igi-111@protonmail.com>"]
|
||||
description = "A bindless library for manipulating terminals."
|
||||
repository = "https://gitlab.redox-os.org/redox-os/termion"
|
||||
|
@ -11,6 +11,7 @@ exclude = ["target", "CHANGELOG.md", "image.png", "Cargo.lock"]
|
|||
|
||||
[dependencies]
|
||||
numtoa = { version = "0.1", features = ["std"]}
|
||||
serde = { version = "1.0", features = ["derive"], optional = true }
|
||||
|
||||
[target.'cfg(not(target_os = "redox"))'.dependencies]
|
||||
libc = "0.2"
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
//! Mouse and key events.
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::io::{Error, ErrorKind};
|
||||
use std::str;
|
||||
|
||||
/// An event reported by the terminal.
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum Event {
|
||||
/// A key press.
|
||||
|
@ -15,6 +19,7 @@ pub enum Event {
|
|||
}
|
||||
|
||||
/// A mouse related event.
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum MouseEvent {
|
||||
/// A mouse button was pressed.
|
||||
|
@ -32,6 +37,7 @@ pub enum MouseEvent {
|
|||
}
|
||||
|
||||
/// A mouse button.
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum MouseButton {
|
||||
/// The left mouse button.
|
||||
|
@ -51,6 +57,7 @@ pub enum MouseButton {
|
|||
}
|
||||
|
||||
/// A key.
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum Key {
|
||||
/// Backspace.
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#![warn(missing_docs)]
|
||||
|
||||
extern crate numtoa;
|
||||
#[cfg(feature = "serde")]
|
||||
extern crate serde;
|
||||
|
||||
#[cfg(target_os = "redox")]
|
||||
#[path="sys/redox/mod.rs"]
|
||||
|
|
Loading…
Reference in New Issue