tinymist_std/concepts/
mod.rs1mod takable;
2use std::{borrow::Cow, path::Path, sync::Arc};
3
4pub use takable::*;
5
6pub mod cow_mut;
7
8mod query;
9pub use query::*;
10
11mod read;
12pub use read::*;
13
14mod marker;
15pub use marker::*;
16
17#[cfg(feature = "typst")]
18pub mod typst;
19
20pub type ImmutStr = Arc<str>;
22pub type ImmutBytes = Arc<[u8]>;
24pub type ImmutPath = Arc<Path>;
26pub type CowStr = Cow<'static, str>;
28
29pub trait FromArc<T> {
31 fn from_arc(arc: Arc<T>) -> Self;
33}
34
35impl<S, T> FromArc<S> for T
36where
37 Arc<S>: Into<T>,
38{
39 fn from_arc(arc: Arc<S>) -> T {
40 arc.into()
41 }
42}
43
44pub trait ArcInto<T> {
46 fn arc_into(self: Arc<Self>) -> T;
48}
49
50impl<S, T> ArcInto<T> for S
51where
52 Arc<S>: Into<T>,
53{
54 fn arc_into(self: Arc<Self>) -> T {
55 self.into()
56 }
57}