pub struct Sl4f { /* private fields */ }
Expand description
Sl4f stores state for all facades and has access to information for all connected clients.
To add support for a new Facade implementation, see the hashmap in Sl4f::new
.
Implementations§
Source§impl Sl4f
impl Sl4f
pub fn new(clients: Arc<RwLock<Sl4fClients>>) -> Result<Sl4f, Error>
Sourcepub fn get_facade(&self, name: &str) -> Option<Arc<dyn Facade>>
pub fn get_facade(&self, name: &str) -> Option<Arc<dyn Facade>>
Gets the facade registered with the given name, if one exists.
Sourcepub async fn cleanup(&self)
pub async fn cleanup(&self)
Implement the Facade trait method cleanup() to clean up state when “/cleanup” is queried.
pub fn print_clients(&self)
Sourcepub async fn print(&self)
pub async fn print(&self)
Implement the Facade trait method print() to log state when “/print” is queried.
Sourcepub fn has_proxy_facade(&self, name: &str) -> bool
pub fn has_proxy_facade(&self, name: &str) -> bool
Returns true if the facade with the given name is hosted by a registered FacadeProvider
.
§Arguments
- ‘name’ - A string representing the name of the facade.
Sourcepub async fn handle_proxy_request(
&self,
facade: String,
command: String,
args: Value,
) -> Result<Value, Error>
pub async fn handle_proxy_request( &self, facade: String, command: String, args: Value, ) -> Result<Value, Error>
Sends a request on a facade hosted by a registered FacadeProvider
and waits
asynchronously for the response.
§Arguments
- ‘facade’ - A string representing the name of the facade.
- ‘command’ - A string representing the command to execute on the facade.
- ‘args’ - An arbitrary JSON Value containing any arguments to the command.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sl4f
impl !RefUnwindSafe for Sl4f
impl !Send for Sl4f
impl !Sync for Sl4f
impl Unpin for Sl4f
impl !UnwindSafe for Sl4f
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> OptionalField for Twhere
T: ?Sized,
impl<T> OptionalField for Twhere
T: ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.