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: observed.rs
    path of file: ./repos/cursive/cursive/src/backends/puppet
    
    the code of the file until where you have to start completion: //! Structs representing output of puppet backend
use crate::reexports::enumset::EnumSet;
use crate::theme::ColorPair;
use crate::theme::Effect;
use crate::Vec2;
use std::ops::Index;
use std::ops::IndexMut;
use std::string::ToString;
use std::sync::Arc;
use std::{fmt, fmt::Display, fmt::Formatter};
use unicode_segmentation::UnicodeSegmentation;
use unicode_width::UnicodeWidthStr;

/// Style of observed cell
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct ObservedStyle {
    /// Colors: front and back
    pub colors: ColorPair,
    /// Effects enabled on observed cell
    pub effects: EnumSet<Effect>,
}

/// Contents of observed cell
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum GraphemePart {
    /// Represents begin of wide character
    Begin(String),
    /// Represents a cell that is filled with continuation of some character that begun in cell with lower x-index.
    Continuation,
}

impl GraphemePart {
    /// Returns true iff GraphemePart is Continuation
    pub fn is_continuation(&self) -> bool {
        matches!(*self, GraphemePart::Continuation)
    }

    /// Returns Some(String) if GraphemePart is Begin(String), else None.
    pub fn as_option(&self) -> Option<&String> {
        match *self {
            GraphemePart::Begin(ref string) => Some(string),
            GraphemePart::Continuation => None,
        }
    }

    /// Returns String if GraphemePart is Begin(String), panics otherwise.
    pub fn unwrap(&self) -> String {
        ma
    
    pub fn find_occurences(&self, pattern: &str) -> Vec<ObservedLine> {
        // TODO(njskalski): test for two-cell letters.
        // TODO(njskalski): fails with whitespaces like "\t".

        let mut hits: Vec<ObservedLine> = vec![];
        for y in self.min().y..self.max().y {
            'x: for x in self.min().x..self.max().x {
                // check candidate.

                if pattern.len() > self.size().x - x {
                    continue;
                }

                let mut pattern_cursor: usize = 0;
                let mut pos_cursor: usize = 0;

                loop {
                    let pattern_symbol = pattern
                        .graphemes(true)
                        .nth(pattern_cursor)
                        .unwrap_or_else(|| {
                            panic!("Found no char at cursor {} in {}", pattern_cursor, &pattern)
                        });

                    let pos_it = Vec2::new(x + pos_cursor, y);

                    let found_symbol: Option<&String> = if let Some(ref cell) = self[pos_it] {
                        cell.letter.as_option()
                    } else {
                        None
                    };

                    match found_symbol {
                        Some(screen_symbol) => {
                            if pattern_symbol == screen_symbol {
                                pattern_cursor += 1;
                                pos_cursor += screen_symbol.width();
                            } else {
                                continue 'x;
                            }
                        }
                        None => {
                            if pattern_symbol == " " {
                                pattern_cursor += 1;
                                pos_cursor += 1;
                            } else {
                                continue 'x;
                            }
                        }
                    };

                    if pattern_cursor == pattern.graphemes(true).count() {
                        break;
                    };
                }

                if pattern_cursor == pattern.graphemes(true).count() {
                    hits.push(ObservedLine::new(self, Vec2::new(x, y), pos_cursor));
                }
            }
        }
        hits
    }