fn parse_fence_info(
info: &str,
) -> Result<(FenceKind, Option<String>), PackError>Expand description
Parse a fence header string into a FenceKind and an optional header name.
Accepts two forms: "kind" (e.g., "adapter") or "kind name" (e.g., "adapter postgres_main").
§Errors
Returns a PackError::Validation if the input is empty, contains more than two whitespace-separated tokens,
or if the kind token is not a recognized FenceKind.
§Examples
ⓘ
let (kind, name) = parse_fence_info("adapter postgres_main").unwrap();
assert_eq!(kind, FenceKind::Adapter);
assert_eq!(name.as_deref(), Some("postgres_main"));
let (kind_only, none_name) = parse_fence_info("adapter").unwrap();
assert_eq!(kind_only, FenceKind::Adapter);
assert!(none_name.is_none());