"description": "Create a [`Buffer`][1] which can be used to store and pull data within\na scope.\n\nBy default the [`BufferSettings`][2] will keep the single last message\npushed to the buffer. You can change that with the optional `settings`\nproperty.\n\nUse the `\"serialize\": true` option to serialize the messages into\n[`JsonMessage`] before they are inserted into the buffer. This\nallows any serializable message type to be pushed into the buffer. If\nleft unspecified, the buffer will store the specific data type that gets\npushed into it. If the buffer inputs are not being serialized, then all\nincoming messages being pushed into the buffer must have the same type.\n\n[1]: crate::Buffer\n[2]: crate::BufferSettings\n\n# Examples\n```\n# crossflow::Diagram::from_json_str(r#\"\n{\n \"version\": \"0.1.0\",\n \"start\": \"fork_clone\",\n \"ops\": {\n \"fork_clone\": {\n \"type\": \"fork_clone\",\n \"next\": [\"num_output\", \"string_output\", \"all_num_buffer\", \"serialized_num_buffer\"]\n },\n \"num_output\": {\n \"type\": \"node\",\n \"builder\": \"num_output\",\n \"next\": \"buffer_access\"\n },\n \"string_output\": {\n \"type\": \"node\",\n \"builder\": \"string_output\",\n \"next\": \"string_buffer\"\n },\n \"string_buffer\": {\n \"type\": \"buffer\",\n \"settings\": {\n \"retention\": { \"keep_last\": 10 }\n }\n },\n \"all_num_buffer\": {\n \"type\": \"buffer\",\n \"settings\": {\n \"retention\": \"keep_all\"\n }\n },\n \"serialized_num_buffer\": {\n \"type\": \"buffer\",\n \"serialize\": true\n },\n \"buffer_access\": {\n \"type\": \"buffer_access\",\n \"buffers\": [\"string_buffer\"],\n \"next\": \"with_buffer_access\"\n },\n \"with_buffer_access\": {\n \"type\": \"node\",\n \"builder\": \"with_buffer_access\",\n \"next\": { \"builtin\": \"terminate\" }\n }\n }\n}\n# \"#)?;\n# Ok::<_, serde_json::Error>(())\n```",
0 commit comments