Skip to content

Latest commit

 

History

History
40 lines (34 loc) · 1.12 KB

File metadata and controls

40 lines (34 loc) · 1.12 KB

lambda-rs lambda-rs

The lambda-rs crate provides a safe, cross-platform API for building applications on the Lambda platform.

Installation

cargo add lambda-rs

Getting started

First window

Getting started with lambda is easy. The following example will create a window with the title "Hello lambda!" and a size of 800x600.

use lambda::{
  runtime::start_runtime,
  runtimes::{
    ApplicationRuntimeBuilder,
    EventLoopPolicy,
  },
};

fn main() {
  let runtime = ApplicationRuntimeBuilder::new("Hello lambda!")
    // Tools/editors should prefer `Wait` to reduce CPU usage when idle.
    .with_event_loop_policy(EventLoopPolicy::Wait)
    .with_window_configured_as(move |window_builder| {
      return window_builder
        .with_dimensions(800, 600)
        .with_name("Hello lambda!");
    })
    .build();

  start_runtime(runtime);
}