pub trait Layout: 'static {
    type Error: StdError;

    const NAMESPACE: &'static str;

    // Required methods
    fn user_cmd(
        &mut self,
        cmd: String,
        tags: Option<u32>,
        output: &str
    ) -> Result<(), Self::Error>;
    fn generate_layout(
        &mut self,
        view_count: u32,
        usable_width: u32,
        usable_height: u32,
        tags: u32,
        output: &str
    ) -> Result<GeneratedLayout, Self::Error>;
}
Expand description

This trait represents a layout generator implementation.

Required Associated Types§

source

type Error: StdError

The error type of user_cmd and generate_layout functions. Use Infallible if you don’t need it.

Required Associated Constants§

source

const NAMESPACE: &'static str

The namespace is used by the compositor to distinguish between layout generators. Two separate clients may not share a namespace. Otherwise, run will return Error::NamespaceInUse.

Required Methods§

source

fn user_cmd( &mut self, cmd: String, tags: Option<u32>, output: &str ) -> Result<(), Self::Error>

This function is called whenever the user sends a command via riverctl send-layout-cmd.

source

fn generate_layout( &mut self, view_count: u32, usable_width: u32, usable_height: u32, tags: u32, output: &str ) -> Result<GeneratedLayout, Self::Error>

This function is called whenever compositor requests a layout.

Implementors§