gix_merge/blob/builtin_driver/
mod.rs1use crate::blob::BuiltinDriver;
2
3impl BuiltinDriver {
4 pub fn as_str(&self) -> &str {
6 match self {
7 BuiltinDriver::Text => "text",
8 BuiltinDriver::Binary => "binary",
9 BuiltinDriver::Union => "union",
10 }
11 }
12
13 pub fn all() -> &'static [Self] {
15 &[BuiltinDriver::Text, BuiltinDriver::Binary, BuiltinDriver::Union]
16 }
17
18 pub fn by_name(name: &str) -> Option<Self> {
20 Self::all().iter().find(|variant| variant.as_str() == name).copied()
21 }
22}
23
24pub mod binary;
26pub use binary::function::merge as binary;
27
28pub mod text;
30pub use text::function::merge as text;