Compare commits
5 Commits
593900a5b8
...
2da0bb3fc7
Author | SHA1 | Date |
---|---|---|
Anna | 2da0bb3fc7 | |
Anna | a4cc0ec115 | |
Anna | ee7ed01ad9 | |
Anna | 7321cb4d14 | |
Anna | 187e8e65dd |
|
@ -1,12 +1,12 @@
|
|||
[package]
|
||||
name = "sestring"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
version = "0.2.0"
|
||||
edition = "2021"
|
||||
authors = ["Anna Clemens <sestring-crate@annaclemens.io>"]
|
||||
description = "SeString parser/encoder for FFXIV-related purposes."
|
||||
license = "EUPL-1.2"
|
||||
keywords = ["ffxiv", "sestring"]
|
||||
repository = "https://git.sr.ht/~jkcclemens/sestring"
|
||||
repository = "https://git.anna.lgbt/ascclemens/sestring"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(backtrace)]
|
||||
#![feature(error_generic_member_access, provide_any)]
|
||||
|
||||
pub mod error;
|
||||
pub mod payload;
|
||||
|
@ -14,7 +14,7 @@ pub use self::{
|
|||
payload::Payload,
|
||||
};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct SeString(pub Vec<Payload>);
|
||||
|
||||
impl SeString {
|
||||
|
|
|
@ -34,7 +34,7 @@ pub use self::{
|
|||
use crate::Error;
|
||||
use std::io::{Read, Cursor, Seek, SeekFrom};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Payload {
|
||||
AutoTranslate(AutoTranslatePayload),
|
||||
DalamudLink(DalamudLinkPayload),
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::{
|
|||
use byteorder::ReadBytesExt;
|
||||
use crate::payload::SeStringChunkKind;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct AutoTranslatePayload {
|
||||
pub group: u8,
|
||||
pub key: u32,
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::io::{Read, Seek};
|
|||
use byteorder::ReadBytesExt;
|
||||
use crate::payload::{SeStringChunkKind, SeInteractableKind};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct DalamudLinkPayload {
|
||||
pub plugin: String,
|
||||
pub command: u32,
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::payload::{Decode, Encode, SeStringChunkKind};
|
|||
use std::io::{Read, Seek};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct EmphasisPayload(pub bool);
|
||||
|
||||
impl EmphasisPayload {
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::payload::{Decode, Encode, SeStringChunkKind};
|
|||
use std::io::{Read, Seek};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct IconPayload(pub u32);
|
||||
|
||||
impl From<u32> for IconPayload {
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::{Error, payload::{Decode, Encode}, Payload};
|
|||
use std::io::{Read, Seek, SeekFrom};
|
||||
use crate::payload::{SeStringChunkKind, SeInteractableKind};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct ItemPayload {
|
||||
pub id: u32,
|
||||
pub hq: bool,
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::{Error, payload::{Decode, Encode}, Payload};
|
|||
use std::io::{Read, Seek, SeekFrom};
|
||||
use crate::payload::{SeStringChunkKind, SeInteractableKind};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct MapLinkPayload {
|
||||
pub territory_type: u32,
|
||||
pub map: u32,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::payload::{Encode, SeStringChunkKind};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct NewLinePayload;
|
||||
|
||||
impl Encode for NewLinePayload {
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::{Error, payload::{Decode, Encode}, Payload};
|
|||
use std::io::{Read, Seek, SeekFrom};
|
||||
use crate::payload::{SeStringChunkKind, SeInteractableKind};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct PlayerPayload {
|
||||
pub server_id: u32,
|
||||
pub name: String,
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::payload::{Decode, Encode, SeStringChunkKind, SeInteractableKind};
|
|||
use std::io::{Read, Seek};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct QuestPayload(pub u32);
|
||||
|
||||
impl QuestPayload {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{Error, payload::{Decode, Encode}, Payload};
|
||||
use std::io::{Read, Seek};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct RawPayload(pub Vec<u8>);
|
||||
|
||||
impl AsRef<[u8]> for RawPayload {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::payload::{Encode, SeStringChunkKind};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct SeHyphenPayload;
|
||||
|
||||
impl Encode for SeHyphenPayload {
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::payload::{Decode, Encode, SeStringChunkKind, SeInteractableKind};
|
|||
use std::io::{Read, Seek};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct StatusPayload(pub u32);
|
||||
|
||||
impl From<u32> for StatusPayload {
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
use std::io::{Read, Seek, SeekFrom};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct TextPayload(pub String);
|
||||
|
||||
impl<T: Into<String>> From<T> for TextPayload {
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::payload::{Decode, Encode, SeStringChunkKind};
|
|||
use std::io::{Read, Seek};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct UiForegroundPayload(pub u32);
|
||||
|
||||
impl From<u32> for UiForegroundPayload {
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::payload::{Decode, Encode, SeStringChunkKind};
|
|||
use std::io::{Read, Seek};
|
||||
use crate::Payload;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct UiGlowPayload(pub u32);
|
||||
|
||||
impl From<u32> for UiGlowPayload {
|
||||
|
|
Loading…
Reference in New Issue