pub struct Place { /* private fields */ }Expand description
Where a session works: a host, a repository and a worktree.
use riff_core::name::{Place, Repo};
let repo = Repo::Git { owner: "como-technologies".into(), name: "riff".into() };
let place = Place::new("pangolin", repo, Some("pr-23"))?;
assert_eq!(place.repo_text(), "como-technologies/riff");
assert_eq!(place.default_thread().unwrap().to_string(), "como-technologies/riff");
// A person has a host and nothing else.
assert!(Place::host_only("pangolin")?.default_thread().is_none());Implementations§
Source§impl Place
impl Place
pub fn new( host: &str, repo: Repo, worktree: Option<&str>, ) -> Result<Self, NameError>
Sourcepub fn host_only(host: &str) -> Result<Self, NameError>
pub fn host_only(host: &str) -> Result<Self, NameError>
The place of a person on the command line: a host only.
pub fn host(&self) -> &str
pub fn repo(&self) -> &Repo
pub fn worktree(&self) -> Option<&str>
Sourcepub fn default_thread(&self) -> Option<ThreadName>
pub fn default_thread(&self) -> Option<ThreadName>
The thread that a session joins in this place: OWNER/REPO. Outside git there is none.
Trait Implementations§
Source§impl Ord for Place
impl Ord for Place
Source§impl PartialOrd for Place
impl PartialOrd for Place
impl Eq for Place
impl StructuralPartialEq for Place
Auto Trait Implementations§
impl Freeze for Place
impl RefUnwindSafe for Place
impl Send for Place
impl Sync for Place
impl Unpin for Place
impl UnsafeUnpin for Place
impl UnwindSafe for Place
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.