You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spiral.rs
    path of file: ./repos/persway/src/server/event_handlers/layout
    
    the code of the file until where you have to start completion: use super::super::traits::WindowEventHandler;
use crate::{
    node_ext::NodeExt,
    utils::{is_persway_tmp_workspace, is_scratchpad_workspace},
};

use anyhow::Result;
use async_trait::async_trait;
use swayipc_async::{Connection, WindowChange, WindowEvent, Workspace};

pub struct Spiral {
    connection: Connection,
}

fn should_skip_layout_of_workspace(workspace: &Workspace) -> bool {
    is_persway_tmp_workspace(workspace) || is_scratchpad_workspace(workspace)
}

impl Spiral {
    pub async fn handle(event: Box<WindowEvent>) {
        if let Ok(mut manager) = Self::new().await {
            manager.handle(event).await;
        }
    }

    pub async fn new() -> Result<Self> {
        let connection = Connection::new().await?;
        Ok(Self { co
    
    async fn layout(&mut self, event: WindowEvent) -> Result<()> {
        log::debug!("spiral manager handling event: {:?}", event.change);
        let tree = self.connection.get_tree().await?;
        let node = tree
            .find_as_ref(|n| n.id == event.container.id)
            .expect(&format!("no node found with id {}", event.container.id));
        let ws = node.get_workspace().await?;
        if should_skip_layout_of_workspace(&ws) {
            log::debug!("skip spiral layout of \"special\" workspace");
            return Ok(());
        }
        if !(node.is_floating_window()
            || node.is_floating_container()
            || node.is_full_screen()
            || node.is_stacked().await?
            || node.is_tabbed().await?)
        {
            let cmd = if node.rect.height > node.rect.width {
                format!("[con_id={}] focus; split v", node.id)
            } else {
                format!("[con_id={}] focus; split h", node.id)
            };
            log::debug!("spiral layout: {}", cmd);
            self.connection.run_command(cmd).await?;
        };

        Ok(())
    }