#![allow(missing_docs, dead_code)]
pub mod appservice;
pub mod authentication;
pub mod authorization;
pub mod client;
pub mod device;
pub mod directory;
pub mod encryption;
pub mod events;
pub mod federation;
pub mod identifiers;
mod percent_encode;
pub mod power_levels;
pub mod presence;
pub mod push;
pub mod room;
pub mod serde;
pub mod signatures;
pub mod space;
pub mod third_party;
mod time;
pub mod to_device;
pub mod version;
pub use version::MatrixVersion;
pub mod error;
pub use error::{MatrixError, UnknownVersionError};
#[macro_use]
pub mod sending;
pub mod http_headers;
pub mod media;
pub mod state;
pub mod user;
pub use crate::state::RoomVersion;
pub use palpo_macros as macros;
extern crate self as palpo_core;
use std::fmt;
use as_variant::as_variant;
use salvo::oapi::{Components, RefOr, Schema, ToSchema};
use ::serde::{Deserialize, Serialize};
pub use self::identifiers::*;
pub use self::serde::{canonical_json, JsonValue, RawJson, RawJsonValue};
pub use self::time::{UnixMillis, UnixSeconds};
pub type Seqnum = i64;
pub type MatrixResult<T> = Result<T, MatrixError>;
#[doc(hidden)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Deserialize, Ord, Hash)]
pub struct PrivOwnedStr(Box<str>);
impl fmt::Debug for PrivOwnedStr {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}
impl ToSchema for PrivOwnedStr {
fn to_schema(components: &mut Components) -> RefOr<Schema> {
<String>::to_schema(components)
}
}
#[derive(Clone, Copy, Debug)]
#[allow(clippy::exhaustive_enums)]
pub enum SendAccessToken<'a> {
IfRequired(&'a str),
Always(&'a str),
None,
}
impl<'a> SendAccessToken<'a> {
pub fn get_required_for_endpoint(self) -> Option<&'a str> {
as_variant!(self, Self::IfRequired | Self::Always)
}
pub fn get_not_required_for_endpoint(self) -> Option<&'a str> {
as_variant!(self, Self::Always)
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[allow(clippy::exhaustive_enums)]
pub enum AuthScheme {
None,
AccessToken,
ServerSignatures,
}
#[derive(ToSchema, Clone, Copy, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[allow(clippy::exhaustive_enums)]
pub enum Direction {
#[default]
#[serde(rename = "b")]
Backward,
#[serde(rename = "f")]
Forward,
}
#[doc(hidden)]
pub mod __private {
pub use bytes;
pub use http;
pub use palpo_macros as macros;
pub use serde;
pub use serde_json;
}