Update Shipping Info using code

I have written the cart page from scratch. I want the user to have the option to checkout as a guest. If the user checks out as a guest, he/she needs to fill out the shipping info for the order. Currently, i don’t see any API that updates the shipping info in the cart backend. Only getCurrentCart() returns the cart info in which there is shipping info. But there is no documentation on how to update that shipping information if I am building the checkout page on my own using code.