Skip to main content

SocketEndpoint

Struct SocketEndpoint 

Source
pub struct SocketEndpoint { /* private fields */ }
Expand description

The owner tree’s local socket: the path v2 binds, the canonical spelling v1 bound, the registration that names it, and the root all three derive from.

resolve touches no filesystem, so a client that starts before its daemon still resolves the one path the daemon will bind, and an absent runtime directory is not an error until a caller binds or publishes.

Implementations§

Source§

impl SocketEndpoint

Source

pub fn resolve(root: &Path, run_dir: &Path) -> Self

Resolve from the owner root and its runtime directory (<root>/.onlyne/run).

The digest covers absolute_path of root, so the spelling has to stop moving before a daemon and its clients can agree. A tree that exists resolves its canonical spelling; one that does not yet own a directory (a caller resolving before bootstrap creates it) resolves a collapsed lexical spelling, and macOS reaches one tree through /var and /private/var. Resolve after bootstrap when the derived name has to match a running daemon’s.

run_dir names only natural.

Source

pub fn root(&self) -> &Path

The canonical owner root the other three paths belong to.

Source

pub fn natural(&self) -> &Path

The canonical v1 spelling, <run_dir>/s, kept for operators and older tooling that print it. Nothing binds or connects here under v2.

Source

pub fn actual(&self) -> &Path

The path bind and connect use: <runtime_dir>/<digest>.sock.

Source

pub fn registration(&self) -> &Path

<runtime_dir>/<digest>.json, the file naming actual.

Source

pub fn short(&self) -> bool

true when the bound path is not the canonical <run_dir>/s spelling, which under v2 is every tree unless a runtime path happens to equal it. Callers log one line about the move.

Source

pub fn publish(&self, reg: &RegistrationFile) -> Result<()>

Write reg at registration.

The caller owns the file: a role workspace writes its own kind, role, and runtime here, and the next bind overwrites whatever was there.

Trait Implementations§

Source§

impl Clone for SocketEndpoint

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SocketEndpoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SocketEndpoint

Source§

impl PartialEq for SocketEndpoint

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SocketEndpoint

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.