tinymist_std/concepts/
mod.rs1mod takable;
2use std::{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>;
26
27pub trait FromArc<T> {
29 fn from_arc(arc: Arc<T>) -> Self;
31}
32
33impl<S, T> FromArc<S> for T
34where
35 Arc<S>: Into<T>,
36{
37 fn from_arc(arc: Arc<S>) -> T {
38 arc.into()
39 }
40}
41
42pub trait ArcInto<T> {
44 fn arc_into(self: Arc<Self>) -> T;
46}
47
48impl<S, T> ArcInto<T> for S
49where
50 Arc<S>: Into<T>,
51{
52 fn arc_into(self: Arc<Self>) -> T {
53 self.into()
54 }
55}