# duat-filetype  [](https://crates.io/crates/duat-filetype) [](https://docs.rs/duat-filetype) [](https://github.com/AhoyISki/duat-filetype)
Filetypes for the Duat text editor
This [`Plugin`][__link0] is included by default, as it is considered a core
utility of duat. It adds the two following traits:
* [`FileType`][__link1]: This trait grants the [`filetype`][__link2] method, which
lets you access the filetype directly. Its implementors are the
[`Buffer`][__link3] widget, [`String`][__link4] and [`&str`][__link5] and [`PathBuf`][__link6] and
[`Path`][__link7].
* [`PassFileType`][__link8]: This trait also has a
[`filetype`][__link9] method, but it requires a
[`Pass`][__link10], bypassing the need to, for example, [`read`][__link11] a
[`Handle<Buffer>`][__link12]. Its implementors are [`RwData<Buffer>`][__link13],
[`Handle<Buffer>`][__link14].
[__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG_W_Gn_kaocAGwCcVPfenh7eGy6gYLEwyIe4G6-xw_FwcbpjYXKEGyZYCbGMbRVrGylbI7YdKLV0G_9mtCxU4OZwGwnWpImGdR09YWSCg21kdWF0LWZpbGV0eXBlZTAuNC4wbWR1YXRfZmlsZXR5cGWCaWR1YXRfY29yZWUwLjkuMA
[__link0]: https://docs.rs/duat_core/0.9.0/duat_core/?search=Plugin
[__link1]: https://docs.rs/duat-filetype/0.4.0/duat_filetype/?search=FileType::filetype
[__link10]: https://docs.rs/duat_core/0.9.0/duat_core/?search=data::Pass
[__link11]: https://docs.rs/duat_core/0.9.0/duat_core/?search=context::Handle::read
[__link12]: https://docs.rs/duat_core/0.9.0/duat_core/?search=context::Handle
[__link13]: https://docs.rs/duat_core/0.9.0/duat_core/?search=data::RwData
[__link14]: https://docs.rs/duat_core/0.9.0/duat_core/?search=context::Handle
[__link2]: https://docs.rs/duat-filetype/0.4.0/duat_filetype/?search=FileType::filetype
[__link3]: https://docs.rs/duat_core/0.9.0/duat_core/?search=buffer::Buffer
[__link4]: https://doc.rust-lang.org/stable/std/string/struct.String.html
[__link5]: https://doc.rust-lang.org/stable/std/primitive.str.html
[__link6]: https://doc.rust-lang.org/stable/std/?search=path::PathBuf
[__link7]: https://doc.rust-lang.org/stable/std/?search=path::Path
[__link8]: https://docs.rs/duat-filetype/0.4.0/duat_filetype/trait.PassFileType.html
[__link9]: https://docs.rs/duat-filetype/0.4.0/duat_filetype/?search=PassFileType::filetype