index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Dim is a media manager written in rust. It uses Diesel as the ORM and rocket for the http/s server"><meta name="keywords" content="rust, rustlang, rust-lang, dim"><title>dim - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../dim/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
  2. </a><h2 class="location"></h2>
  3. </nav>
  4. <nav class="sidebar"><a class="sidebar-logo" href="../dim/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
  5. </a><h2 class="location"><a href="#">Crate dim</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.3.0-rc6</li><li><a id="all-types" href="all.html">All Items</a></li></ul></div><section><div class="block"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li><li><a href="#functions">Functions</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../dim/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><div id="settings-menu" tabindex="-1">
  6. <a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div>
  7. </div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
  8. <h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">dim</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/dim/lib.rs.html#1-81">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Dim is a media manager written in rust.
  9. It uses Diesel as the ORM and rocket for the http/s server</p>
  10. <p>The project is split up into several crates:</p>
  11. <ul>
  12. <li><a href="../database/index.html"><code>database</code></a> - Holds all the database models including some frequently used db operations</li>
  13. <li><a href="routes/index.html"><code>routes</code></a> - All of the routes that we expose over http are stored in there</li>
  14. <li><a href="scanners/index.html"><code>scanners</code></a> - The filesystem scanner and daemon code is located here
  15. ffmpeg that is used by several parts of dim</li>
  16. </ul>
  17. <h2 id="building"><a href="#building">Building</a></h2>
  18. <p>Dim can easily be built with cargo build –release.
  19. When built with –release, build.rs will compile the web ui and embed it into dim.</p>
  20. <h2 id="to-run"><a href="#to-run">To run</a></h2>
  21. <p>Dim can be ran using docker, by pulling vgarleanu/dim-server, or locally.
  22. If ran locally, make sure PostgreSQL is running with the password for postgres: dimpostgres</p>
  23. <h2 id="testing"><a href="#testing">Testing</a></h2>
  24. <p>To test run <code>make test</code> in the root, or <code>cargo test</code> in the root of each module including the
  25. root dir.</p>
  26. </div></details><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2>
  27. <div class="item-table"><div class="item-row"><div class="item-left import-item" id="reexport.get_global_settings"><code>pub use routes::settings::<a class="fn" href="routes/settings/fn.get_global_settings.html" title="fn dim::routes::settings::get_global_settings">get_global_settings</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item" id="reexport.init_global_settings"><code>pub use routes::settings::<a class="fn" href="routes/settings/fn.init_global_settings.html" title="fn dim::routes::settings::init_global_settings">init_global_settings</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item" id="reexport.set_global_settings"><code>pub use routes::settings::<a class="fn" href="routes/settings/fn.set_global_settings.html" title="fn dim::routes::settings::set_global_settings">set_global_settings</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item" id="reexport.GlobalSettings"><code>pub use routes::settings::<a class="struct" href="routes/settings/struct.GlobalSettings.html" title="struct dim::routes::settings::GlobalSettings">GlobalSettings</a>;</code></div><div class="item-right docblock-short"></div></div></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
  28. <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="core/index.html" title="dim::core mod">core</a></div><div class="item-right docblock-short"><p>Module contains our core initialization logic.</p>
  29. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="errors/index.html" title="dim::errors mod">errors</a></div><div class="item-right docblock-short"><p>Module contains all the error definitions used in dim, and returned by the web-service.</p>
  30. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="external/index.html" title="dim::external mod">external</a></div><div class="item-right docblock-short"><p>Module contains our external api interfaces</p>
  31. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="fetcher/index.html" title="dim::fetcher mod">fetcher</a></div><div class="item-right docblock-short"><p>Contains the code for fetching assets like posters and stills.</p>
  32. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="logger/index.html" title="dim::logger mod">logger</a></div><div class="item-right docblock-short"><p>Contains our custom logger for rocket</p>
  33. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="routes/index.html" title="dim::routes mod">routes</a></div><div class="item-right docblock-short"><p>Contains all of the routes exposed by the webapi.
  34. This module contains all the routes supported by the API.</p>
  35. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="scanners/index.html" title="dim::scanners mod">scanners</a></div><div class="item-right docblock-short"><p>Contains our media scanners and so on.</p>
  36. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="stream_tracking/index.html" title="dim::stream_tracking mod">stream_tracking</a></div><div class="item-right docblock-short"><p>Contains the fairing which tracks streams across rest api</p>
  37. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="streaming/index.html" title="dim::streaming mod">streaming</a></div><div class="item-right docblock-short"><p>Contains all the logic needed for streaming and on-the-fly transcoding.</p>
  38. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="tree/index.html" title="dim::tree mod">tree</a></div><div class="item-right docblock-short"><p>Tree-like structure for representing directories of files.</p>
  39. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="utils/index.html" title="dim::utils mod">utils</a></div><div class="item-right docblock-short"><p>Various utilities</p>
  40. </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="websocket/index.html" title="dim::websocket mod">websocket</a></div><div class="item-right docblock-short"><p>Websocket related logic.</p>
  41. </div></div></div><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2>
  42. <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.balanced_or_tree.html" title="dim::balanced_or_tree macro">balanced_or_tree</a></div><div class="item-right docblock-short"><p>Source: https://github.com/seanmonstar/warp/issues/619
  43. Takes a list of handler expressions and <code>or</code>s them together
  44. in a balanced tree. That is, instead of <code>a.or(b).or(c).or(d)</code>,
  45. it produces <code>(a.or(b)).or(c.or(d))</code>, thus nesting the types
  46. less deeply, which provides improvements in compile time.</p>
  47. </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.json.html" title="dim::json macro">json</a></div><div class="item-right docblock-short"><p>Construct a <code>serde_json::Value</code> from a JSON literal.</p>
  48. </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.warp_try.html" title="dim::warp_try macro">warp_try</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.warp_unwrap.html" title="dim::warp_unwrap macro">warp_unwrap</a></div><div class="item-right docblock-short"></div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2>
  49. <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.setup_logging.html" title="dim::setup_logging fn">setup_logging</a></div><div class="item-right docblock-short"><p>Function builds a logger drain that drains to a json file located in logs/ and also to stdout.</p>
  50. </div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="dim" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.63.0 (4b91a6ea7 2022-08-08)" ></div>
  51. </body></html>