Functions
normalize_prefix
1
str
▼
Return ``"/" + prefix.strip("/")``.
Raises ``ConfigurationError`` if the resul…
normalize_prefix
1
str
▼
def normalize_prefix(prefix: str) -> str
Return"/" + prefix.strip("/").
RaisesConfigurationError if the result would be "/"— mounting
at root has no effect vs. registering the routes directly on the parent.
Parameters
| Name | Type | Description |
|---|---|---|
prefix |
str |
Returns
str
prefixed_path
2
str
▼
Return the sub-app route's path after applying the mount prefix.
``prefix`` is…
prefixed_path
2
str
▼
def prefixed_path(path: str, prefix: str) -> str
Return the sub-app route's path after applying the mount prefix.
prefix is pre-normalized to "/<something>"(see
normalize_prefix()); pathis whatever the sub-app registered
(expected to start with"/").
Parameters
| Name | Type | Description |
|---|---|---|
path |
str |
|
prefix |
str |
Returns
str
_check_sub_app_simple
1
None
▼
Refuse sub-apps that carry state mount_app v1 can't hoist safely.
_check_sub_app_simple
1
None
▼
def _check_sub_app_simple(sub_state: MutableAppState) -> None
Parameters
| Name | Type | Description |
|---|---|---|
sub_state |
MutableAppState |
hoist
3
None
▼
Merge ``sub_state`` into ``parent_state`` at ``prefix``.
Does not validate tha…
hoist
3
None
▼
def hoist(parent_state: MutableAppState, sub_state: MutableAppState, prefix: str) -> None
Mergesub_state into parent_state at prefix.
Does not validate that either state is mutable / pre-freeze — the caller
(App.mount_app) owns the lifecycle checks.
Parameters
| Name | Type | Description |
|---|---|---|
parent_state |
MutableAppState |
|
sub_state |
MutableAppState |
|
prefix |
str |