1/*! For license information please see 2715d495.aeb7f775.js.LICENSE.txt */ 2"use strict";(globalThis.webpackChunkfigurawiki=globalThis.webpackChunkfigurawiki||[]).push([[694],{7010(e,r,n){n.r(r),n.d(r,{assets:()=>o,contentTitle:()=>i,default:()=>h,frontMatter:()=>l,metadata:()=>c,toc:()=>d});var s=n(3274),t=n(5776);const l={},i=void 0,c={id:"globals/Data/Future",title:"Future",description:"Object that contains result of operation that cant be finished immediately",source:"@site/docs/globals/Data/Future.md",sourceDirName:"globals/Data",slug:"/globals/Data/Future",permalink:"/globals/Data/Future",draft:!1,unlisted:!1,editUrl:"https://github.com/figuramc/wiki/tree/main/docs/globals/Data/Future.md",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Buffer",permalink:"/globals/Data/Buffer"},next:{title:"InputStream",permalink:"/globals/Data/InputStream"}},o={},d=[{value:"<code>getOrError()</code>",id:"getOrError",level:3},{value:"<code>getValue()</code>",id:"getValue",level:3},{value:"<code>hasError()</code>",id:"hasError",level:3},{value:"<code>isDone()</code>",id:"isDone",level:3},{value:"<code>throwError()</code>",id:"throwError",level:3}];function a(e){const r={a:"a",admonition:"admonition",code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,t.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.p,{children:"Object that contains result of operation that cant be finished immediately"}),"\n",(0,s.jsx)(r.admonition,{type:"warning",children:(0,s.jsx)(r.p,{children:"This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions."})}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"getOrError",children:(0,s.jsx)("code",{children:"getOrError()"})}),"\n",(0,s.jsx)(r.p,{children:"Throws error if it occurred while execution of this future, returns value otherwise"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"getOrError()\n"})}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Returns:"})}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsx)(r.tbody,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)("code",{children:"AnyType"})}),(0,s.jsx)(r.td,{children:"-"})]})})]}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Example:"})}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"-- example coming soon\n"})}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"getValue",children:(0,s.jsx)("code",{children:"getValue()"})}),"\n",(0,s.jsx)(r.p,{children:"Returns value of this future object if future was executed successfully"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"getValue()\n"})}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Returns:"})}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsx)(r.tbody,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)("code",{children:"AnyType"})}),(0,s.jsx)(r.td,{children:"-"})]})})]}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Example:"})}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"-- example coming soon\n"})}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"hasError",children:(0,s.jsx)("code",{children:"hasError()"})}),"\n",(0,s.jsx)(r.p,{children:"Checks if error occurred while this future execution"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"hasError()\n"})}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Returns:"})}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsx)(r.tbody,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)("code",{children:(0,s.jsx)(r.a,{href:"/tutorials/types/Booleans",children:"Boolean"})})}),(0,s.jsx)(r.td,{children:"-"})]})})]}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Example:"})}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"-- example coming soon\n"})}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"isDone",children:(0,s.jsx)("code",{children:"isDone()"})}),"\n",(0,s.jsx)(r.p,{children:"Checks if future is done, either successfully or with error"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"isDone()\n"})}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Returns:"})}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsx)(r.tbody,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)("code",{children:(0,s.jsx)(r.a,{href:"/tutorials/types/Booleans",children:"Boolean"})})}),(0,s.jsx)(r.td,{children:"-"})]})})]}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Example:"})}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"-- example coming soon\n"})}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"throwError",children:(0,s.jsx)("code",{children:"throwError()"})}),"\n",(0,s.jsx)(r.p,{children:"Throws an error if it occurred while execution of this future."}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"throwError()\n"})}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Returns:"})}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsx)(r.tbody,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)("code",{children:"nil"})}),(0,s.jsx)(r.td,{children:"-"})]})})]}),"\n",(0,s.jsx)(r.p,{children:(0,s.jsx)(r.strong,{children:"Example:"})}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-lua",children:"-- example coming soon\n"})}),"\n",(0,s.jsx)(r.hr,{})]})}function h(e={}){const{wrapper:r}={...(0,t.R)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},8034(e,r,n){var s=n(9474),t=Symbol.for("react.element"),l=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,c=s.__SECRET_INT
2ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,n){var s,l={},d=null,a=null;for(s in void 0!==n&&(d=""+n),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(a=r.ref),r)i.call(r,s)&&!o.hasOwnProperty(s)&&(l[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps)void 0===l[s]&&(l[s]=r[s]);return{$$typeof:t,type:e,key:d,ref:a,props:l,_owner:c.current}}r.Fragment=l,r.jsx=d,r.jsxs=d},3274(e,r,n){e.exports=n(8034)},5776(e,r,n){n.d(r,{R:()=>i,x:()=>c});var s=n(9474);const t={},l=s.createContext(t);function i(e){const r=s.useContext(l);return s.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function c(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),s.createElement(l.Provider,{value:r},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.