pub fn generate_service<'a, W: Write>(&self, service: &Service, sink: &'a mut W) -> Result<()> {
        // Write the main entry point used to instanciate the service.
        write!(
            sink,
            r#"export const {} = {{
            get: (session) => {{
                return Services.get("{}", "{}", session).then((service_id) => {{
                    // object_id is always 0 for the service itself.
                    return new {}Session(0, service_id, session);
                }});
            }},
        }};"#,
            service.name,
            service.name,
            crate::helpers::get_fingerprint(&self.ast),
            service.interface
        )?;
        writeln!(sink)?;

        Ok(())
    }
// Services are mapped to trait that implement both their defining interface and the
// core common one.
Services are mapped to trait that implement both their defining interface and the
core common one.
Services are mapped to trait that implement both their defining interface and the core common one .
pub fn generate_service<'a, W: Write>(&self, service: &Service, sink: &'a mut W) -> Result<()> {
        // Write the main entry point used to instanciate the service.
        write!(
            sink,
            r#"export const {} = {{
            get: (session) => {{
                return Services.get("{}", "{}", session).then((service_id) => {{
                    // object_id is always 0 for the service itself.
                    return new {}Session(0, service_id, session);
                }});
            }},
        }};"#,
            service.name,
            service.name,
            crate::helpers::get_fingerprint(&self.ast),
            service.interface
        )?;
        writeln!(sink)?;
        Ok(())
    }
pub fn generate_service < ' a , W : Write > ( & self , service : & Service , sink : & ' a mut W ) -> Result < ( ) > { // Write the main entry point used to instanciate the service. write ! ( sink r#"export const {} = {{
            get: (session) => {{
                return Services.get("{}", "{}", session).then((service_id) => {{
                    // object_id is always 0 for the service itself.
                    return new {}Session(0, service_id, session);
                }});
            }},
        }};"# service name service name crate helpers get_fingerprint ( self ast ) service interface ) ? ; writeln ! ( sink ) ? ; Ok ( ( ) ) }
Services are mapped to trait that implement both their defining interface and the
core common one.
Services are mapped to trait that implement both their defining interface and the core common one .
&self
service
&Service
sink
&'a mut W
&self
service
&Service
sink
&'a mut W