fn handle_content_update(&mut self, ctx: &RpcCtx, body: &Value) {
        #[derive(Deserialize, Debug)]
        struct Update {
            annotations: Vec<Annotation>,
            #[serde(rename = "ops")]
            operations: Vec<Operation>,
        }

        #[derive(Deserialize, Debug)]
        struct Event {
            view_id: String,
            update: Update,
        }

        let event: Event = serde_json::from_value(body.clone()).unwrap();

        self.create_view_if_required(ctx, &event.view_id);
        let view = self.views.get_mut(&event.view_id).unwrap();

        view.update_buffer(event.update.operations);
    }
/// Handle the "update" event.
///
/// It create a new buffer, apply all the event directives, swith this
/// new buffer with the old one than trigger a redraw.
///
/// The event is compose of differents `Operation`. Each one indicate how
/// to fill the new buffer. The posible operations are:
/// - "copy" -> Copy a part of the old buffer into the new one.
/// - "skip" -> Keep a number of line empty.
/// - "invalidate" -> Mark some lines as not available because the core
///     doesn't have given their content yet.
/// - "ins" -> Insert some new content.
Handle the "update" event.
It create a new buffer, apply all the event directives, swith this
new buffer with the old one than trigger a redraw.

The event is compose of differents `Operation`. Each one indicate how
to fill the new buffer. The posible operations are:
"copy" -> Copy a part of the old buffer into the new one.
"skip" -> Keep a number of line empty.
"invalidate" -> Mark some lines as not available because the core
doesn't have given their content yet.
"ins" -> Insert some new content.
Handle the " update " event . It create a new buffer apply all the event directives swith this new buffer with the old one than trigger a redraw . The event is compose of differents ` Operation ` . Each one indicate how to fill the new buffer . The posible operations are : " copy " - > Copy a part of the old buffer into the new one . " skip " - > Keep a number of line empty . " invalidate " - > Mark some lines as not available because the core doesn ' t have given their content yet . " ins " - > Insert some new content .
fn handle_content_update(&mut self, ctx: &RpcCtx, body: &Value) {
        #[derive(Deserialize, Debug)]
        struct Update {
            annotations: Vec<Annotation>,
            #[serde(rename = "ops")]
            operations: Vec<Operation>,
        }
        #[derive(Deserialize, Debug)]
        struct Event {
            view_id: String,
            update: Update,
        }
        let event: Event = serde_json::from_value(body.clone()).unwrap();
        self.create_view_if_required(ctx, &event.view_id);
        let view = self.views.get_mut(&event.view_id).unwrap();
        view.update_buffer(event.update.operations);
    }
fn handle_content_update ( & mut self , ctx : & RpcCtx , body : & Value ) { # [ derive ( Deserialize Debug ) ] struct Update { annotations : Vec < Annotation > , # [ serde ( rename " " ) ] operations : Vec < Operation > , } # [ derive ( Deserialize Debug ) ] struct Event { view_id : String , update : Update , } let event : Event = serde_json :: from_value ( body . clone ( ) ) . unwrap ( ) ; self . create_view_if_required ( ctx , & event . view_id ) ; let view = self . views . get_mut ( & event . view_id ) . unwrap ( ) ; view . update_buffer ( event . update . operations ) ; }
Handle the "update" event.
Handle the " update " event .
&mut self
ctx
&RpcCtx
body
&Value
&mut self
ctx
&RpcCtx
body
&Value