pub enum BoundaryPreset {
Layered,
Hexagonal,
FeatureSliced,
Bulletproof,
}Expand description
Built-in architecture presets.
Each preset expands into a set of zones and import rules for a common
architecture pattern. User-defined zones and rules merge on top of the
preset defaults (zones with the same name replace the preset zone;
rules with the same from replace the preset rule).
§Examples
use fallow_config::BoundaryPreset;
let preset: BoundaryPreset = serde_json::from_str(r#""layered""#).unwrap();
assert!(matches!(preset, BoundaryPreset::Layered));Variants§
Layered
Classic layered architecture: presentation → application → domain ← infrastructure. Infrastructure may also import from application (common in DI frameworks).
Hexagonal
Hexagonal / ports-and-adapters: adapters → ports → domain.
FeatureSliced
Feature-Sliced Design: app > pages > widgets > features > entities > shared. Each layer may only import from layers below it.
Bulletproof
Bulletproof React: app → features → shared + server.
Feature modules are isolated from each other via autoDiscover: every
immediate child of src/features/ becomes its own features/<name> zone,
and cross-feature imports are reported as boundary violations.
Top-level files in src/features/ are classified by the logical
features parent zone, so barrels can re-export child features while
non-barrel top-level files still obey the features boundary rule.
Implementations§
Source§impl BoundaryPreset
impl BoundaryPreset
Sourcepub fn default_config(
&self,
source_root: &str,
) -> (Vec<BoundaryZone>, Vec<BoundaryRule>)
pub fn default_config( &self, source_root: &str, ) -> (Vec<BoundaryZone>, Vec<BoundaryRule>)
Expand the preset into default zones and rules.
source_root is the directory prefix for zone patterns (e.g., "src", "lib").
Patterns are generated as {source_root}/{zone_name}/**.
Trait Implementations§
Source§impl Clone for BoundaryPreset
impl Clone for BoundaryPreset
Source§fn clone(&self) -> BoundaryPreset
fn clone(&self) -> BoundaryPreset
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BoundaryPreset
impl Debug for BoundaryPreset
Source§impl<'de> Deserialize<'de> for BoundaryPreset
impl<'de> Deserialize<'de> for BoundaryPreset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for BoundaryPreset
impl JsonSchema for BoundaryPreset
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for BoundaryPreset
impl PartialEq for BoundaryPreset
Source§fn eq(&self, other: &BoundaryPreset) -> bool
fn eq(&self, other: &BoundaryPreset) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for BoundaryPreset
impl Serialize for BoundaryPreset
impl Eq for BoundaryPreset
impl StructuralPartialEq for BoundaryPreset
Auto Trait Implementations§
impl Freeze for BoundaryPreset
impl RefUnwindSafe for BoundaryPreset
impl Send for BoundaryPreset
impl Sync for BoundaryPreset
impl Unpin for BoundaryPreset
impl UnsafeUnpin for BoundaryPreset
impl UnwindSafe for BoundaryPreset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.