pub struct StackBranch {
pub name: BranchName,
pub parent: Option<BranchName>,
pub pr: Option<u64>,
pub created: DateTime<Utc>,
}Expand description
A branch within a stack.
Branch names are validated at construction time to prevent:
- Path traversal attacks (
../) - Shell metacharacters (
$,;,|, etc.) - Invalid git branch name characters
Fields§
§name: BranchNameBranch name (validated).
parent: Option<BranchName>Parent branch name (None for root branches based on main/master).
pr: Option<u64>Associated PR number (if submitted).
created: DateTime<Utc>When this branch was added to the stack.
Implementations§
Source§impl StackBranch
impl StackBranch
Sourcepub fn new(name: BranchName, parent: Option<BranchName>) -> Self
pub fn new(name: BranchName, parent: Option<BranchName>) -> Self
Create a new stack branch with pre-validated names.
Trait Implementations§
Source§impl Clone for StackBranch
impl Clone for StackBranch
Source§fn clone(&self) -> StackBranch
fn clone(&self) -> StackBranch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StackBranch
impl Debug for StackBranch
Source§impl<'de> Deserialize<'de> for StackBranch
impl<'de> Deserialize<'de> for StackBranch
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StackBranch
impl RefUnwindSafe for StackBranch
impl Send for StackBranch
impl Sync for StackBranch
impl Unpin for StackBranch
impl UnsafeUnpin for StackBranch
impl UnwindSafe for StackBranch
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
Mutably borrows from an owned value. Read more