MMM: Reexport in the SDK

This commit is contained in:
Natty 2023-10-25 19:45:59 +02:00
parent c4a8ebebf3
commit 6ed6066b1f
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
5 changed files with 25 additions and 18 deletions

29
Cargo.lock generated
View File

@ -603,6 +603,7 @@ dependencies = [
"cfg-if", "cfg-if",
"itoa", "itoa",
"ryu", "ryu",
"serde",
"static_assertions", "static_assertions",
] ]
@ -1507,6 +1508,20 @@ dependencies = [
"serde_json", "serde_json",
] ]
[[package]]
name = "magnetar_mmm_parser"
version = "0.2.1-alpha"
dependencies = [
"compact_str",
"either",
"emojis",
"nom",
"nom_locate",
"serde",
"tracing",
"unicode-segmentation",
]
[[package]] [[package]]
name = "magnetar_nodeinfo" name = "magnetar_nodeinfo"
version = "0.2.1-alpha" version = "0.2.1-alpha"
@ -1521,6 +1536,7 @@ version = "0.2.1-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",
"http", "http",
"magnetar_mmm_parser",
"magnetar_sdk_macros", "magnetar_sdk_macros",
"serde", "serde",
"serde_json", "serde_json",
@ -1640,19 +1656,6 @@ dependencies = [
"windows-sys", "windows-sys",
] ]
[[package]]
name = "mmm_parser"
version = "0.2.1-alpha"
dependencies = [
"compact_str",
"either",
"emojis",
"nom",
"nom_locate",
"tracing",
"unicode-segmentation",
]
[[package]] [[package]]
name = "nom" name = "nom"
version = "7.1.3" version = "7.1.3"

View File

@ -1,5 +1,5 @@
[package] [package]
name = "mmm_parser" name = "magnetar_mmm_parser"
version.workspace = true version.workspace = true
edition.workspace = true edition.workspace = true
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
@ -9,6 +9,7 @@ either = { workspace = true }
emojis = { workspace = true } emojis = { workspace = true }
nom = { workspace = true } nom = { workspace = true }
nom_locate = { workspace = true } nom_locate = { workspace = true }
compact_str = { workspace = true } compact_str = { workspace = true, features = ["serde"] }
serde = { workspace = true, features = ["derive"] }
tracing = { workspace = true } tracing = { workspace = true }
unicode-segmentation = { workspace = true } unicode-segmentation = { workspace = true }

View File

@ -12,13 +12,14 @@ use nom::multi::{many0, many0_count, many1, many1_count, many_till, separated_li
use nom::sequence::tuple; use nom::sequence::tuple;
use nom::{IResult, Offset, Parser, Slice}; use nom::{IResult, Offset, Parser, Slice};
use nom_locate::LocatedSpan; use nom_locate::LocatedSpan;
use serde::{Deserialize, Serialize};
use std::collections::HashMap; use std::collections::HashMap;
use std::convert::{identity, Infallible}; use std::convert::{identity, Infallible};
use std::marker::PhantomData; use std::marker::PhantomData;
use tracing::trace; use tracing::trace;
use unicode_segmentation::UnicodeSegmentation; use unicode_segmentation::UnicodeSegmentation;
#[derive(Copy, Clone, Debug, Eq, PartialEq)] #[derive(Copy, Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub enum MentionType { pub enum MentionType {
Community, Community,
User, User,
@ -33,7 +34,7 @@ impl MentionType {
} }
} }
#[derive(Clone, Debug, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub enum Token { pub enum Token {
PlainText(CompactString), PlainText(CompactString),
Sequence(Vec<Token>), Sequence(Vec<Token>),

View File

@ -5,6 +5,7 @@ edition.workspace = true
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
[dependencies] [dependencies]
magnetar_mmm_parser = { path = "../magnetar_mmm_parser" }
magnetar_sdk_macros = { path = "./macros" } magnetar_sdk_macros = { path = "./macros" }
chrono = { workspace = true, features = ["serde"] } chrono = { workspace = true, features = ["serde"] }
@ -15,4 +16,4 @@ serde_json = { workspace = true }
ts-rs = { workspace = true, features = ["chrono", "chrono-impl"] } ts-rs = { workspace = true, features = ["chrono", "chrono-impl"] }
unicode-segmentation = { workspace = true } unicode-segmentation = { workspace = true }

View File

@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use ts_rs::TS; use ts_rs::TS;
pub use magnetar_mmm_parser as mmm;
pub mod endpoints; pub mod endpoints;
pub mod types; pub mod types;
pub mod util_types; pub mod util_types;