pub struct StateBuilder { /* private fields */ }Expand description
A builder for a State.
This type can be constructed with State::builder.
Implementations§
Source§impl StateBuilder
impl StateBuilder
Sourcepub fn build(self) -> Result<Rc<State>, StateError>
pub fn build(self) -> Result<Rc<State>, StateError>
Builds the state.
The server to connect to is chosen as follows:
- If
Self::with_server_fdwas used, that FD is used. - Otherwise, if
Self::with_server_display_namewas used, that display name is used. - Otherwise, if the
WAYLAND_SOCKETenvironment variable is set, that FD is used. - Otherwise, the display name from the
WAYLAND_DISPLAYenvironment variable is used.
Sourcepub fn without_server(self) -> Self
pub fn without_server(self) -> Self
Constructs a state without a server.
Sourcepub fn with_server_fd(self, fd: &Rc<OwnedFd>) -> Self
pub fn with_server_fd(self, fd: &Rc<OwnedFd>) -> Self
Sets the server file descriptor to connect to.
Sourcepub fn with_server_display_name(self, name: &str) -> Self
pub fn with_server_display_name(self, name: &str) -> Self
Sets the server display name to connect to.
Sourcepub fn with_logging(self, log: bool) -> Self
pub fn with_logging(self, log: bool) -> Self
Enables or disables logging.
If this function is not used, then logging is enabled if and only if the
WL_PROXY_DEBUG environment variable is set to 1.
Sourcepub fn with_log_prefix(self, prefix: &str) -> Self
pub fn with_log_prefix(self, prefix: &str) -> Self
Sets a log prefix for messages emitted by this state.
Auto Trait Implementations§
impl Freeze for StateBuilder
impl RefUnwindSafe for StateBuilder
impl !Send for StateBuilder
impl !Sync for StateBuilder
impl Unpin for StateBuilder
impl UnwindSafe for StateBuilder
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